Hi Mat,
I do like your stuff. You have a very good sense of visual style. I do love the subtle bottom shadow of the “sticky” sidebar tabs. It’s a brilliant solution to create a visual separation.
That said: What I do not like is your CSS code.
IMO .tc-reveal
should be avoided for styling. There are enough .tc-*
named definitions that can be used to reliably style UI elements. The reveal-widget may be removed in future UI elements by using the much more versatile Conditional Shortcut Syntax, introduced with v5.3.x.
<% if %>
works similar to the <$list
-widget and does not force the construction of DOM elements. So there should be no tc-reveals in the future.
I also think your CSS code is way too specific. It does contain stuff like .tc-xx > p > tc-page-controls
, which targets specific HTML tags like P. So if the TW UI changes in the slightest bit, your CSS will break.
See: Child combinator - CSS: Cascading Style Sheets | MDN –
The child combinator (>
) is placed between two CSS selectors. It matches only those elements matched by the second selector that are the direct children of elements matched by the first.
IMO .tc-xx .tc-page-controls
will do the same thing and gives UI devs the freedom to change the UI DOM structure in the future. eg: The TW UI creates a lot of redundant P tags, that should be gone in future UIs.
I think you will not need any tc-reveal:has()
pseudo-classes to meet your goals.
And last but not least. Avoid !important
at all cost. It only causes problems for your users in the future, if they need to apply their own modifications, they will be forced to use !important !important
.
-mario