1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-29 11:30:28 +00:00
TiddlyWiki5/tw2/source/tiddlywiki.com/tiddlywiki-com/NestedStyleSheets.tid
Jeremy Ruston a1c8ac624f Added first pass at support for building TiddlyWiki 2.6.x with TW5
There are still some whitespace and attribute ordering issues, but the
result runs correctly.
2012-05-29 22:02:38 +01:00

19 lines
845 B
Plaintext

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.