Tech
CSS Doesn't Need More Power — It Needs Better Boundaries
Also available in Español
The Problem
A team hits a styling problem that CSS won't cooperate with. Something needs to change based on a click, a scroll position, a piece of application state. So they reach for more power.
A heavier selector. An !important . Sometimes CSS gets skipped entirely — element.style.display = 'none' , set directly from a click handler, because it felt more reliable than trusting the cascade to do what was asked.
None of the last three problems...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to