Had to update my recent post about :root and custom properties and add an important detail:
You might think it makes sense to define custom props on :root because they are inherited *everywhere*. But this isn’t always the case, as @matuzo pointed out. ()
::selection and ::backdrop, for example, don’t inherit them!
https://matthiasott.com/notes/custom-properties-beyond-the-root
@matthiasott
No, I didn't think that it makes sense to define it in :root cause of performance.
https://lisilinhart.info/posts/css-variables-performance/
I mean it might depend on the count of calc() and overall project size.
I did so for the theming like for colors
https://github.com/redaktor/widgets-preview/blob/master/src/theme/material/_color.m.css
or typo, e.g to generate the “solid baseline measurements” where any column independent of used size-classes or media has the same baseline under each character …
Unfortunately my messages were never answered. As said, there are some “huge” fedi projects :)
@sl007 That’s interesting… the test that Lisi mentions is not online anymore but on the screenshot it looks like it used JavaScript to test the performance of different custom property manipulations. Would be interesting to see whether this is slower – which would be my guess – than the CSS object model.
Sure, but I couldn't find any people anymore using the CSS object model outside JS ;)