Empty states with CSS and the `:only-child` selector
Here's a quick trick with the :only-child
selector to display an empty state in a list.
thoughts and inspiration on designing, programming, and writing for the web
Here's a quick trick with the :only-child
selector to display an empty state in a list.
Tl;dr: We use !important
because it solves annoying specificity issues. Despite being overkill in most situations, we haven't come across any practical drawbacks from globally enabling it.
If you want to learn more about how we came to that conclusion and how CSS specificity works, read on!
How to set up Tailwind CSS in Vite with Laravel.