twColor(colorName){ return $tw.wiki.extractTiddlerDataItem( $tw.wiki.getTiddlerText("$:/palette","$:/palettes/Vanilla"), colorName ); }--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/b531c512-9404-4b4e-ab23-3e471ba70e40%40googlegroups.com.
Hi Matt
Is there a recommended way of getting palette colors in JavaScript? I think I need this for working with HTML custom elements where CSS outside of the shadow shadow DOM cannot apply.This is what I'm doing right now:twColor(colorName){return $tw.wiki.extractTiddlerDataItem($tw.wiki.getTiddlerText("$:/palette","$:/palettes/Vanilla"),colorName);}There’s a bit more to it than that because palette colours can indirect through to other colours (e.g. in the default “Vanilla” palette, the colour "blockquote-bar” is set to "<<colour muted-foreground>>”).But, it turns out that the core erroneously uses the above technique in a recent update to the framed editor:I’ve raised a ticket proposing that we add a core API for obtaining palette values, and then use it to correct those cases.Best wishesJeremy
--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddly...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/7943f11b-65f6-47e4-9dac-1d0105a06eba%40googlegroups.com.
\define custom-color(name, color)<$text text="""--$name$: """ /><<colour $color$>>\end
/* The macro is necessary because tiddlywiki will munge '--' Trying to be clever with inserting a comment inside the '--' didn't work.*/
to-do { <<custom-color hover-background-color message-background>>; <<custom-color hover-foreground-color message-foreground>>;
<<custom-color delete-background-color diff-delete-background>>; <<custom-color delete-foreground-color diff-delete-foreground>>;
<<custom-color remove-button-background-color sidebar-tab-background-selected>>; <<custom-color remove-button-border-color sidebar-tab-background>>; <<custom-color remove-button-foreground-color sidebar-muted-foreground>>;}
div.line-item:hover { background-color: var(--hover-background-color); color: var(--hover-foreground-color); }To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/7943f11b-65f6-47e4-9dac-1d0105a06eba%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/519ac7b1-90af-4de5-97c3-9e4e9e07c9e2%40googlegroups.com.