On Wednesday, September 9, 2020 at 12:31:51 PM UTC+2, [email protected] wrote:
> I want to use dynamic css (as described here: > https://tiddlywiki.com/static/Q%253A%2520How%2520can%2520I%2520use%2520a%2520custom%2520field%2520to%2520style%2520a%2520tiddler%253F.html) > > to style a tiddler that is transcluded by another tiddler. Unfortunately > the transcluded tiddler does not show the style. The same happens if I use > data-tags. A minimal example is: Have a closer look at these examples. The dynamic creation of CSS should be the last option. Most of the time the other possibilities are preferable. https://tiddlywiki.com/#How%20to%20apply%20custom%20styles:%5B%5BHow%20to%20apply%20custom%20styles%5D%5D%20%5B%5BCustom%20styles%20by%20data-tags%5D%5D > Css > [data-tags*="colorblue"] .tc-tiddler-body {color:blue;font-style: italic;} > > Tiddler A > {{Tiddler B}} > > Tiddler B (tagged colorblue) > This should be blue > > Tiddler B shows italic blue text as expected. I would expect Tiddler A to > show the same (italic blue), but it does not. What am I missing? > > Thanks for any help! > Transclusion doesn't create any "wrapper" elements. So there is no information in Tiddler A, that Tiddler B has been tagged. You'd need to create a template. tiddler: A {{B||xTemplate}} xTemplate <div data-tags={{!!tags}}><$view field=text mode=htmlencoded/></div> CSS [data-tags*="colorblue"] {color:blue;font-style: italic;} See the attached file. You can download and drag & drop import it. have fun! mario -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/b63df6ee-2adc-4027-83d9-74a7bcfb521bo%40googlegroups.com.
data-tag-with-transclusion.json
Description: application/json

