Hmmm, Good idea, but CSS doesn't work that way. ...
At the moment, we only have the tag attribute, that's assigned to the rendered tiddler in a way, that browsers can understand it. ... BUT there is a problem with that approach. Tags can have names, that are not valid in CSS eg: spaces ...
So I did prepare a pull request [1] to fix the tag-name problem. ... It wouldn't solve your usecase, because you need some extra levels of flexibility. ...
Danielo and Tobias brought up the idea of having a special field, that could hold different CSS attributes [2]. I wasn't happy with that solution, since I think it isn't generic enough, to cover all usecases. ... And since it doesn't work with yours, we have to do better :/
I'll need to think about that again ....
regards
mario
PS: Reading Siniy-Kit's post
I had an idea, that may help you. .. But I need some testing. I'll post something, when I know more. [1]
https://github.com/Jermolene/TiddlyWiki5/pull/2737[2]
https://github.com/Jermolene/TiddlyWiki5/pull/2737#issuecomment-276042733