5 ms·
There's a bunch of things you can't do with style attributes, just to pick a few: - Pseudo-classes (e.g., :hover, :focus) - Pseudo-elements (e.g., ::before, :
by morbicer 2y ago
There's a bunch of things you can't do with style attributes, just to pick a few:
- Pseudo-classes (e.g., :hover, :focus)
- Pseudo-elements (e.g., ::before, ::after)
- Media queries
- Keyframes and animations
And the DX in a larger project isn't great either.
On the other hand, this upcoming standard is a great addition for collocating styles
https://developer.mozilla.org/en-US/docs/Web/CSS/@scope https://developer.mozilla.org/en-US/docs/Web/CSS/@scope
- nilslindemann 2y agohttps://developer.mozilla.org/en-US/docs/Web/CSS/@layer https://developer.mozilla.org/en-US/docs/Web/CSS/@layer also solves a lot of problems.
- jeanlucas 2y agoIndeed, it also solves a lot of problems