1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-15 10:00:00 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/howtos/Hard_Linebreaks_with_CSS.tid
Mario Pietsch 19085a1277 Add data attributes to ViewTemplate (#3209)
* change 3 set-widgets to 1 var-widget call. Add data-tags and userClass.

* add new documentation and change the existing one accordingly.
2018-04-24 22:08:20 +01:00

27 lines
757 B
Plaintext

created: 20170126174506507
modified: 20170126211042714
tags: [[Hard Linebreaks in WikiText]]
title: Hard Linebreaks with CSS
type: text/vnd.tiddlywiki
Since TiddlyWiki Version 5.1.16, it's possible to apply customs styles with `data-` attributes. see: [[How to apply custom styles]]
The [[Custom data-styles]] stylesheet tiddler contains the following definition:
```
[data-tags*="example-hardlinebreaks"] .tc-tiddler-body {
word-break: normal;
word-wrap: break-word;
white-space: pre-wrap;
}
```
If rendered without the tag, the content of "Hard Linebreaks with CSS - Example" will be shown like this:
>{{Hard Linebreaks with CSS - Example}}
----
Open the tiddler to see the custom CSS rules applied: [[Hard Linebreaks with CSS - Example]]