1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-24 18:47:20 +00:00
TiddlyWiki5/test/tiddlywiki.2.6.5/source/tiddlywiki.com/tiddlywiki-com/NestedStyleSheets.tid

19 lines
845 B
Plaintext
Raw Normal View History

2011-12-03 11:53:29 +00:00
title: NestedStyleSheets
modifier: blaine
created: 20110211110651
modified: 20110211131019
tags: features
creator: psd
Within a CustomStyleSheet, you can include the text of another tiddler by including it in double square brackets. For example, if the tiddler MyFavouriteColour contains {{{#ff763e}}}, and the StyleSheet tiddler contained:
{{{
#mainMenu {background-color:[[MyFavouriteColour]];}
}}}
Then, the effect is that each CSS declaration will be set to {{{background-color: #ff763e;}}}.
In practice, for small bits of text like a colour, it makes sense to use TiddlerSlicing format to reference a chunk of text within a tiddler. See ColorPalette and StyleSheetColors for an example.
Of course, you can use this mechanism to redirect any part of a stylesheet, not just colours. And you can nest references for more complex effects.