[TW5] Weird behavior of style sheets when using type=text/css

67 views
Skip to first unread message

Ton Gerner

unread,
Feb 1, 2014, 3:36:29 PM2/1/14
to tiddl...@googlegroups.com
Hi all,

When I started with TW5 I used style sheets enclosed in triple backticks:

```
all styles
```

At that time there wasn't even the possibility to set a type.
Dave Gifford showed me the style sheet(s) he used and it contained the triple backticks to make the styles 'readable'.
Note: Dave - and may be many others - still use the triple backtick trick, see e.g. [1]

@ Dave
It is not allowed anymore according to the TW gurus. See discussion starting at [2].

So I started using type=text/css. I had to enter it manually, it is not (yet) in the list.

During 'refactoring' the style sheets of my guides I tried to leave out the 'pre' elements like "html", "html body" and/or "html body.tw-body". In many cases I could do without these 'pre' elements, but there were weird things I could not explain, e.g.:

html .tw-tiddler-controls svg {
     fill                
: #99CCFF;
}

needed 'html' as pre element but it was not needed while hovering:

.tw-tiddler-controls button:hover svg {
     fill                
: #04B;
}

Today I found much more weird behavior:

Tiddlers with type text/css (recommended for style sheets) behave strange:
1) styles are applied without the style sheet tagged with $:/tags/stylesheet.
2) renaming of the style sheet (from $:/_stylesheet to Stylesheet) does the style sheet tiddler vanish.

You can imagine that 1) can give very strange results, especially when you have a few style sheets. You delete the tag $:/tags/stylesheet and the applied styles are still there!
It took some time before I realized what happened.

For more information and how to repeat my results see [3]

Using type=text/plain did not give these weird results.

Be aware! My advice: use type=text/plain. In TW5.0.8 there will be type=text/css in the list

Cheers,

Ton


[1] http://www.giffmex.org/tw5mall.htm
[2] https://groups.google.com/d/msg/tiddlywiki/UOBPRMjWbqU/iKbH-Rv6-ZYJ
[3] https://github.com/Jermolene/TiddlyWiki5/issues/395
Reply all
Reply to author
Forward
0 new messages