Query -- Why is "Style by Tag" Deprecated?

194 views
Skip to first unread message

@TiddlyTweeter

unread,
Oct 17, 2018, 2:10:49 PM10/17/18
to tiddl...@googlegroups.com
See: https://tiddlywiki.com/#How%20to%20apply%20custom%20styles%20by%20tag

The older method of "Style by Tag" is now deprecated. A new method has been added: https://tiddlywiki.com/#
I would like to be clearer why.

I did notice, previously, that under some conditions "Style by Tag" could fail.

It looked to me like a "cascade issue"--i.e. that the method of styling could fail under some conditions as the cascade order in TW is not fully predictable under "Style by Tag." On the other hand it still looks workable IF specificity is asserted.

I'm just interested. I think CSS design matters and the simplest approach that ensures clear application of CSS wins.

Any thoughts?

Best wishes
Josiah

@TiddlyTweeter

unread,
Oct 17, 2018, 3:15:24 PM10/17/18
to TiddlyWiki
Email users please note I corrected an error on the links in the previous post.

Mark S.

unread,
Oct 17, 2018, 4:56:03 PM10/17/18
to TiddlyWiki
Here's some reading. When you understand it, you can explain it to me ;-)



(esp Mario's comments on 8/30/16)


As I understand it, the tc-tagged requires escaping for non-latin characters. But my understanding is pretty superficial.

HTH
-- Mark

Mat

unread,
Oct 17, 2018, 5:14:50 PM10/17/18
to TiddlyWiki
You can still style by tag, see https://tiddlywiki.com/#Custom%20styles%20by%20data-tags

Does this satisfy your question or do you require an answer to why particularly the old way of tagging was not good with a "tc-tagged-uri%20encoded%20tag"?

<:-)

Mark S.

unread,
Oct 17, 2018, 5:33:08 PM10/17/18
to TiddlyWiki
I'd like to know!
Thanks
-- Mark

@TiddlyTweeter

unread,
Oct 17, 2018, 5:56:53 PM10/17/18
to TiddlyWiki
So my "cascade theory" was, sadly, wrong! Looking at the discussions I basically doubt I'd ever have come across the issues under debate. Though I confess I'm still not sure quite what the issue was? :-)

-- J.

Mat

unread,
Oct 17, 2018, 6:27:59 PM10/17/18
to TiddlyWiki
Well, there was a general request for ways to style individual tiddlers. The tc-tagged method was the only way but it was quirky in that you had to (1) use a tag to begin with which is not always desirable and (2) the tag name had to be uri encoded in the stylesheet which is just poor UI for something as important as being able to style a tiddler.

Mario did a fantastic job in solving it and implementing several ways to do it; tag or title or a class field. IMO this is superior to the previous approach.

<:-)

Mark S.

unread,
Oct 17, 2018, 7:20:09 PM10/17/18
to TiddlyWiki
Hi Mat,

Thanks for the explanation!

The reasons sound good. It just feels like there should be a little more fanfare (maybe a thread announcement) when major changes are deployed. Even if you avidly read the 5.1.16 release notes, you would not know that tc-tagged- was going away. You probably wouldn't even realize that there was now an alternative to tc-tagged. 

“But look, you found the notice, didn’t you?”
“Yes,” said Arthur, “yes I did. It was on display in the bottom of a locked filing cabinet stuck in a disused lavatory with a sign on the door saying ‘Beware of the Leopard.”


Thanks!
-- Mark

TonyM

unread,
Oct 17, 2018, 9:18:59 PM10/17/18
to TiddlyWiki
Ha Ha Mark

All,

Just in case it is of relevance, 

ControlPanel > Info > Advanced > Stylesheets

or

$:/core/ui/ControlPanel/Stylesheets


List all the stylesheets, and the tag pill can be used to reorder them, thus allowing one to deal with the fact they are cascading stylesheets.


Regards
Tony

Jeremy Ruston

unread,
Oct 18, 2018, 2:44:26 AM10/18/18
to tiddl...@googlegroups.com
> you would not know that tc-tagged- was going away

It's not going away; "deprecated" just means that users are discouraged from using it because there's now a better alternative.

Best wishes

Jeremy

PMario

unread,
Oct 18, 2018, 4:58:25 AM10/18/18
to TiddlyWiki
Hi,

The most important reason is this:

At tag: Doctor Who creates a class name: tc-tagged-Doctor%20Who

The CSS setting needed is: tc-tagged-Doctor\%20Who

English is relatively simple to fix. ... But other character sets produce class names like this: tc-tagged-%D1%81%D0%BB%D0%BE%D0%BC%D0%B0%D0%BD%D0%BD%D1%8B%D0%B9

I think this is error prone and broken. It should be completely removed in a future version.

have fun!
mario

@TiddlyTweeter

unread,
Oct 18, 2018, 7:36:45 AM10/18/18
to TiddlyWiki

Thanks PMario

NOW I really better understand it.

Next Question: Are there other advantages in the new method(s)?

I discovered, by trial and error, that the cascade in TW CSS is not always easy to fathom. I'm reluctant to use imperatives (i.e. ! or prefix "body") unless needed. Once I know the cascade order that issue disappears.

So, my question, is: do the new methods improve the situation with cascades?

Best wishes
Josiah

Mat

unread,
Oct 18, 2018, 9:52:35 AM10/18/18
to TiddlyWiki
@TiddlyTweeter wrote:
 
So, my question, is: do the new methods improve the situation with cascades?

I'd say the new definition "format" (i.e [data-...] ) doesn't change the specificity from tc-tagged so the priority is not changed. But, as you know, cascading means that the last run style definition "wins". Which one is last is not up to the individual definition but instead the order in which they are defined in the stylesheed AND the order in which the stylesheets are processed. That latter aspect is problematic which is why I raised this issue.

<:-)

@TiddlyTweeter

unread,
Oct 18, 2018, 10:32:31 AM10/18/18
to TiddlyWiki
Mat

I seen that issue you raised on GitHub. Its good what its covers.

IMO the cascade in TW can get quite complex to figure out if you hit a problem. Part of that is slack practice--i.e. overdoing add-on styling via too many tiddlers rather than adding to a "mother" sheet where you can better control it. Part of that issue TW invites as its very liberal.

IMO some kind of overview could be helpful. On "Vanilla" and its cousins workings in particular.

I really like Thomas Elmiger's BRICKS plugin as it gets to CSS ground zero in a way that I find illuminating.

Best wishes
Josiah
 
@TiddlyTweeter wrote...
 
So, my question, is: do the new methods improve the situation with cascades?

Mat replied ...

Mat

unread,
Oct 18, 2018, 2:19:42 PM10/18/18
to TiddlyWiki
@TiddlyTweeter wrote:

IMO the cascade in TW can get quite complex to figure out if you hit a problem. Part of that is slack practice--i.e. overdoing add-on styling via too many tiddlers rather than adding to a "mother" sheet where you can better control it.

IMO, a single monolithic mother stylesheet goes against all that TW stands for and we should go in the exact opposite direction; We should split up the current theme(?) stylesheets into meaningful chunks - BUT then use the usual filter techniques to assemble them into some kind of overviewable aggregation that also sets the cascading order of them.

(Crazy idea: Maybe tiddlers could themselves be style definitions? The title is the selector and the text is the declarations. Maybe fields for sub selectors. This way it'd be very simple to reuse declarations. And it would be super simple to try out stuff; just overwrite such shadow style tids and delete if you regret. And we could tag styles or add other meta data.)

IMO, CSS hackability is one of the weaker areas in TW if you consider that hackability is a main objective and how powerful CSS is in TW.

<:-)

@TiddlyTweeter

unread,
Oct 20, 2018, 6:15:03 AM10/20/18
to TiddlyWiki
Mat wrote:
IMO, a single monolithic mother stylesheet goes against all that TW stands for and we should go in the exact opposite direction; We should split up the current theme(?) stylesheets into meaningful chunks...

IMO, CSS hackability is one of the weaker areas in TW if you consider that hackability is a main objective and how powerful CSS is in TW.

Right. I think that is one of most the interesting things about Thomas' "Bricks" plugin which allows one to modularise the CSS so its less monolithic. By way of demo he went through Vanilla & the additional tools (e.g. font setting) and broke in up into more manageable units (see, e.g. https://tid.li/tw5/test/bricks.html#Stylesheet%20Manager). You can either leave them as "modules" or "generate" compacted stylesheets at will in the cascade order you want.

Best, J.

Reply all
Reply to author
Forward
0 new messages