On Saturday, July 31, 2021 at 12:50:43 PM UTC-7 Si wrote:

> For example say I wanted every link to a tiddler with the tag "Purple" to 
> appear purple.
> Just wondering if this is possible without diving into something like 
> $:/core/modules/widgets/link.js 
> <https://tiddlywiki.com/#%24%3A%2Fcore%2Fmodules%2Fwidgets%2Flink.js>?
>

Put the following line of CSS into a tiddler tagged with $:/tags/Stylesheet:
[data-tags*="purple"] .tc-tiddler-body .tc-tiddlylink { color:purple; }

Alternatively, instead of using tags, you can use the value from a 
"linkcolor" field, like this:
<$list filter="[has[linkcolor]]">
   <div>
   [data-tiddler-title^="<<currentTiddler>>"] .tc-tiddler-body 
.tc-tiddlylink { color:{{{ [<currentTiddler>get[linkcolor]] }}}; }
   </div>
</$list>
 
Notes:
* The $list find each tiddler that has non-blank linkcolor field
* The CSS defines a "data-tiddler-title" rule for each matching tiddler, 
where the color attribute value is retrieved from that tiddler's 
"linkcolor" field
* The <div>...</div> is not required, but simply puts the results for each 
matching tiddler on a separate line for easier reading

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 tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/2567291c-00f0-496c-93f7-a6649b8d7d2an%40googlegroups.com.

Reply via email to