News for hackers. Stuff that matters.
Re:Help choose the syntax for CSS Nesting by hypertele-Xii on Friday December 16, 2022 @02:55AM (#34011982)
> Think about the amount of characters wasted on having to write a whole separate rule to add a hover effect or something similar.

So... 20 bytes or so? A whopping 20 megabytes per a million websites.

Seems like a very, very, very small optimization.

Re:Help choose the syntax for CSS Nesting by eCa on Friday December 16, 2022 @04:08AM (#34012460)
20 bytes per rule. While not a fan of the syntax[1], there’s the advantage when reading of seeing that rules are explicitly nested versus doing string parsing of rule definitions.

[1] In particular the significant space char difference between &. And & .

Re:Help choose the syntax for CSS Nesting by hypertele-Xii on Friday December 16, 2022 @05:32AM (#34012939)
Why does a website need more than one :hover rule?
Re:Help choose the syntax for CSS Nesting by extra88 on Friday December 16, 2022 @08:00AM (#34014059)
At minimum, you'll likely have different effects for links than for buttons.

Component-centered design is very common so the styles for each component that would benefit from :hover may have its own variation on it, for the color differences if nothing else.

:hover is not the only interaction pseudo-class, :focus and :active can also be nested.

Re:Help choose the syntax for CSS Nesting by interstice on Friday December 16, 2022 @05:27PM (#34021451)
Every pseudo class * everything that needs that pseudo class * time taken to write/reason/check each one