TIL of a visual way to see CSS Cascade
POSTED ON:
Ever wonder what gets priority?
Ever wish it was in a funnel?
Why is this useful?
Because when you're writing CSS, there's a specificity. MDN
As your CSS starts to grow, things can get real hairy real fast, and you start scoping your CSS. Some of you may even tack on hacks like !important
.
And you can do weird stuff like do it's specificity weight.
But then questions start arising: will !important
be higher priority than say, the Shadow DOM generated object?
This funnel clears that up!
See the Pen The Entire Cascade (as a funnel) by Miriam Suzanne (@miriamsuzanne) on CodePen.
Related TILs
Tagged: css