This is a stripped-down version of a single section of Grok TiddlyWiki, optimized for fast loading and readability by search engines. Some features are missing.

For the full Grok TiddlyWiki experience, please visit the wiki version of this page.

Ex:ConditionalStyle/answer

 14th October 2024 at 9:56pm

To accomplish this, simply wrap the class in a conditional expression so that the CSS doesn't show up if the config tiddler isn't set appropriately:

<% if [[$:/config/ShowFunnyText]text[yes]] %>
.my-funny-class2 {
  background-color: blue;
  color: yellow;
  font-size: 150%;
  border: 3px dotted orange;
  text-align: right;
}
<% endif %>

Note that, as discussed above, the content type must not be text/css here, or conditional expressions won't be evaluated.

The filter can be written in several ways; for instance, you could equivalently use:

[{$:/config/ShowFunnyText}match[yes]]
Go to question: Ex:ConditionalStyle