From 6071f3d385cc75c2837544d86a3d0b6ff88d384e Mon Sep 17 00:00:00 2001 From: Markqz Date: Wed, 1 Oct 2014 13:06:44 -0800 Subject: [PATCH] Create How to apply custom style classes by tag --- .../How to apply custom style classes by tag | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 editions/tw5.com/tiddlers/howtos/How to apply custom style classes by tag diff --git a/editions/tw5.com/tiddlers/howtos/How to apply custom style classes by tag b/editions/tw5.com/tiddlers/howtos/How to apply custom style classes by tag new file mode 100644 index 000000000..327ded50a --- /dev/null +++ b/editions/tw5.com/tiddlers/howtos/How to apply custom style classes by tag @@ -0,0 +1,30 @@ +created: 20141001132300000 +modified: 20141001132300000 +tags: Learning +title: How to apply custom style classes by tag +type: text/vnd.tiddlywiki + +You can create a tag that will apply custom style to a tiddler by using the form: + +``` +.tc-tagged- +``` + +where `` is the name of the tag which you will give to any tiddler to which you wish to apply the styles defined in `.tc-tagged-`. + +For instance if you create a style sheet (see [[Using Stylesheets]] for details on creating style sheets) with class .`tc-tagged-NightReader` like this: + +``` +.tc-tagged-NightReader { + background-color:black; + color:orange; + padding: 35px 35px; +} +.tc-tagged-NightReader .tc-tiddler-body { +font-size: 1.5em; +} +``` + +then you can apply the class `NightReader` to any tiddler that you want to display in a format possible more suitable for night viewing. + +Note that the `NightReader` class is applied to the entire tiddler and not just the tiddler text, so you may need to increase the specificity of your style definitions to make sure that only the tiddler content you want is affected by the style. (as is demonstrated here by `.tc-tagged-NightReader .tc-tiddler-body`.