On Friday, August 28, 2015 at 2:01:25 PM UTC-7, Mat wrote:
>
> Using the tc-tagged-<tagname> 
> <http://tiddlywiki.com/#How%20to%20apply%20custom%20styles%20by%20tag> 
> technique you can style tiddlers individually.
> But how do I set an image that I have as a tiddler, e.g Motovun Jack.svg 
> <http://tiddlywiki.com/#Motovun%20Jack.svg>, to be the background in some 
> other tiddler?
> The doc link above gives example:
> background-image: url(./tardis_back.svg);
> but this path is not relevant in this case and merely writing the name of 
> the image tiddler does not work.
>
>
To use the content of an image tiddler in your CSS, you need two things:

1) The 'type' field of the stylesheet tiddler should be blank (or set to 
"TiddlyWiki 5").  This allows the content to be "wikified", so that 
embedded macros can be processed
2) Use the <<datauri>> macro to fetch the image tiddler content and format 
it as a base64-encoded URI that can be embedded in the CSS, like this:
background-image: url(<<datauri "Motovun Jack.svg">>);

see http://tiddlywiki.com/#datauri%20Macro

enjoy,
-e

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/d1bddb68-b524-40fb-91bd-acb90ffc4227%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to