I wasted a day on CSS selector performance to make a website load 2ms faster | Trys Mudford
Picture me holding Trys back and telling him, “Leave it alone, mate, it’s not worth it!”
I like the approach here: logical properties and sensible default type and spacing.
Picture me holding Trys back and telling him, “Leave it alone, mate, it’s not worth it!”
Laying out sheet music with CSS grid—sounds extreme until you see it abstracted into a web component.
We need fluid and responsive music rendering for the web!
This is a great thought exercise in progressive enhancement …that Scott then turns into a real exercise!
Heydon does a very good job of explaining why throwing away the power of selectors makes no sense.
Utility-first detractors complain a lot about how verbose this is and, consequently, how ugly. And it is indeed. But you’d forgive it that if it actually solved a problem, which it doesn’t. It is unequivocally an inferior way of making things which are alike look alike, as you should. It is and can only be useful for reproducing inconsistent design, wherein all those repeated values would instead differ.
He’s also right on the nose in explaining why something as awful at Tailwind could get so popular:
But CSS isn’t new, it’s only good. And in this backwards, bullshit-optimized economy of garbage and nonsense, good isn’t bad enough.
You might want to use `display: contents` …maybe.
A little fix for Safari.
If you’re going to toggle the display of content with CSS, make sure the more complex selector does the hiding, not the showing.
Separate your concerns.
Trying to understand a different mindset to mine.