[TW5] How style size and color for transcluded image?

98 views
Skip to first unread message

Mat

unread,
Aug 8, 2015, 1:19:59 PM8/8/15
to TiddlyWiki
How do I apply some formatting to e.g this:

{{$:/core/images/chevron-right}}

I hope to control the size of the displayed image and, ideally, also the color. Those core images do appear both in different sizes and colors so it should be doable, right? 

Thank you!

<:-)

Jeremy Ruston

unread,
Aug 8, 2015, 1:34:31 PM8/8/15
to TiddlyWiki
Hi Mat

The core uses CSS to apply colours and sizes to transcluded inline SVG images, like this:

<span class="mybutton">{{$:/core/images/chevron-right}}</span>

And in the stylesheet:

body.tc-body .mybutton svg {
fill: red;
width: 2em;
height: 2em;
}

Often you can apply the class to the surrounding button, avoiding introducing the extra span.

Best wishes

Jeremy.


--
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 tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
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/dbb4e1c3-0816-4a7f-a9e5-14182d04754f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Mat

unread,
Aug 8, 2015, 2:23:41 PM8/8/15
to TiddlyWiki, jeremy...@gmail.com
Great! Thanks!

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