Menu

#SpecifiCity

8 posts

Feed·
8 of 8 posts
Why I spent years trying to make CSS states predictable
🖼️
0

Why I spent years trying to make CSS states predictable

DEV Community·Andrey Yamanov·6 months ago
#q2PmuEiO

Have you ever changed the order of two CSS rules and broken a component without changing the logic? .btn:hover { background: dodgerblue; } .btn[disabled] { background: gray; } Both selectors have specificity (0, 1, 1).…

15s
Read More
📰
0

Alternatives to the !important Keyword

CSS-Tricks·Saleh Mubashar·6 months ago
#4ZBcJS0Z

Cascade layers, specificity tricks, smarter ordering, and even some clever selector hacks can often replace !important with something cleaner, more predictable, and far less embarrassing to explain to your future self.…

15s
Read More