Help with colour macro in stylesheet

I know you can use the <<colour>> macro to give an object a color based on the selected palette.
For example, I can with give a color to the borders of a tiddler with a specific tag using a tiddler tagged $:/tags/Stylesheet, like so:

[data-tags*="Example"] {
  border: 1px solid <<colour dropzone-background>>;
}

This works fine, but I tried and tried on other stylesheet but in all my attempts I’m always doing something wrong (I looked the documentation but I did little progress)

Specifically I was trying to edit this tiddler $:/plugins/kookma/utility/styles/wikitext-macro of the awesome plugin $:/plugins/kookma/commander by Mohammad, which while practically perfect, has a couple of visual incompatibilities with a dark palette. And so I was trying to modify that tiddler in such a way that it fits the chosen palette.

The tiddler in question is $:/plugins/kookma/utility/styles/wikitext-macro (I added some line breaks here for readability):

.doc-example { margin: 1em 0; padding: 0.8em 0; } 
.doc-example:hover { background-color: #f7f7f9; } 
.doc-example ul { margin-bottom: 0; padding-bottom: 0; margin-top: 0.2em; } 
.doc-example pre:first-child { margin-top: 0; } 
.doc-example-result { border-left: 5px solid #bbb; border-right: 5px solid #bbb; margin-left: 0; margin-right: 0; padding: 0 10px; } 
.doc-example-result ul { margin-left: 0; padding-left: 10px; } 
.doc-example-result ol { margin-left: 0; padding-left: 20px; }

In particular the color in .doc-example:hover { background-color: #f7f7f9; }

• How can I make this fixed color to be one from the palette instead? (I was thinking of using <<colour>> as in the example above, but after so many failed attempts I’m not so sure that it’s the right path to follow)

$:/plugins/kookma/utility/styles/wikitext-macro is a shadow tiddler that has a type field set to text/css. This type signals that the tiddler content is “pure CSS”, and thus doesn’t parse any embedded wikitext, such as <<colour ...>>.

If you clear the type field (or set it to text/vnd.tiddlywiki), then you should be able to use the <<colour>> macro as you want.

enjoy,
-e

1 Like

I see, that’s great, thank you so much!

As a side note, what’s the benefit of having the type field set to text/css over text/vnd.tiddlywiki?