On Wednesday, December 27, 2017 at 1:31:16 PM UTC-8, coda coder wrote:
>
> Quote: To make a macro available to all tiddlers, define it in a tiddler
> that has the tag $:/tags/Macro
> <https://tiddlywiki.com/#%24%3A%2Ftags%2FMacro>
> More here: https://tiddlywiki.com/#Macro%20Definitions%20in%20WikiText
>
That only applies to *macro definitions* (i.e., variables). This is
because $:/core/ui/PageTemplate contains this line:
<$importvariables filter="[[$:/core/ui/PageMacros]]
[all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]]">
which references "...[tag[$/Tags/Macro]...", which explicitly pulls in
macro definitions from tiddlers tagged that way.
To set global *styles*, there is a different tag to use:
"$:/tags/Stylesheet"
To properly achieve your desired result:
1) Create a stylesheet tiddler (e.g., "MyStyles") and tag it with
"$:/tags/Stylesheet". Note that this tiddler should NOT have the "<style>"
and "</style> HTML syntax nor any other non-CSS content (i.e, NO <$select>
widgets)... just the CSS declarations by themselves, like this:
.tc-tiddler-frame { background-color:{{$:/temp/tag2}}; }
body {font-family: {{$:/temp/tagfont}}}
p { font-size: {{$:/temp/tagfontsize}} }
Note: in your posted style definitions, you used ".background" as a
classname. However, the actual classname to use to control the tiddler
background color is .tc-tiddler-frame (which you correctly referenced in
your original post)
Next, put the <$select> widgets into another tiddler (e.g., "SetMyStyles"),
like this:
Color change:
<$select tiddler='$:/temp/tag2'>
<option value='lightblue'>lightblue</option>
<option value='rgb(137, 243, 183)'>lightgreen</option>
<option value='lightgrey'>lightgrey</option>
<option value='white'>white</option>
</$select>
Font change:
<$select tiddler='$:/temp/tagfont'>
<option value='Arial'>Standard</option>
<option value='Times New Roman'>Times</option>
</$select>
Fontsize change:
<$select tiddler='$:/temp/tagfontsize'>
<option value='12px'>sehr klein</option>
<option value='16px'>klein</option>
<option value='20px'>mittel</option>
<option value='25px'>groß</option>
</$select>
When you view that tiddler and make your selections from the droplist
controls that are shown, your choices are stored in "$:/temp/..." tiddlers
containing the desired CSS attribute values, which are then automatically
referenced from the stylesheet you created. Note that these choices will
persist even when the tiddler containing the <$select> widgets is not
displayed since the values you choose are stored separately.
Q.E.D.
enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/314eeb2c-0962-42f2-88a8-255dfa9a361f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.