Background image works via stylesheet but not style block

60 views
Skip to first unread message

Mat

unread,
Jul 18, 2017, 10:32:31 AM7/18/17
to TiddlyWiki
I succeed in getting this to work

background-image: url(<<datauri "cat.jpg">>);

when it is in a separate stylesheet. But when it is in a local style block it doesn't work. 


Help appreciated!

<:-)

codacoder...@outlook.com

unread,
Jul 18, 2017, 10:53:10 AM7/18/17
to TiddlyWiki
That's weird.  Testing in Firefox, using devtools, if you disable/enable the background-image rule (or the class), the image appears.

I even tried a transclusion

{{Using styleblock attempt 1}}

Nope.

Strange!

Mat

unread,
Jul 18, 2017, 1:56:37 PM7/18/17
to TiddlyWiki
Ok, many attempts by now... but I found it:

This works for local styleblock:

background-image: url(<$macrocall $name="datauri" title="cat.jpg" $output="text/plain"/>);

It is not clear to my why the direct call works in a separate SS but not in a block.

<:-)
Reply all
Reply to author
Forward
0 new messages