Skip to main content
CSS-Tricks
  • Articles
  • Notes
  • Links
  • Guides
  • Almanac
  • Picks
  • Shuffle
Search

Articles Tagged
specificity

21 Articles
{
,

}
Direct link to the article Quick Reminder That :is() and :where() Are Basically the Same With One Key Difference
selectors specificity

Quick Reminder That :is() and :where() Are Basically the Same With One Key Difference

I’ve seen a handful of recent posts talking about the utility of the :is() relational pseudo-selector. No need to delve into the details other than to say it can help make compound selectors a lot more readable.

:is(section, article, aside, 
…
Geoff Graham on Mar 20, 2025
Direct link to the article Solved by CSS: Donuts Scopes
at-rules specificity

Solved by CSS: Donuts Scopes

Donut scoping addresses the challenge of preventing parent styles from leaking to nested content. Originating from a 2011 concept by Nicole Sullivan, the issue has evolved, culminating in 2024's @scope at-rule. This allows for more precise CSS styling, safeguarding content from unwanted inheritance while managing global CSS complexities.
Juan Diego Rodríguez on Nov 22, 2024
Direct link to the article :has is an unforgiving selector
:has :is :where specificity

:has is an unforgiving selector

A little thing happened on the way to publishing the CSS :has() selector to the ol’ Almanac. I had originally described :has() as a “forgiving” selector, the idea being that anything in its argument is evaluated, even if one or …

Geoff Graham on Jan 11, 2023
Direct link to the article Taming the Cascade With BEM and Modern CSS Selectors
:has :is :where bem cascade specificity

Taming the Cascade With BEM and Modern CSS Selectors

BEM. Like seemingly all techniques in the world of front-end development, writing CSS in a BEM format can be polarizing. But it is – at least in my Twitter bubble – one of the better-liked CSS methodologies.

Personally, I think …

Liam Johnston on Jan 17, 2023
Direct link to the article Using CSS Cascade Layers to Manage Custom Styles in a Tailwind Project
cascade layers specificity tailwind

Using CSS Cascade Layers to Manage Custom Styles in a Tailwind Project

If a utility class only does one thing, chances are you don’t want it to be overridden by any styles coming from elsewhere. One approach is to use !important to be 100% certain the style will be applied, regardless of …

Ollie Williams on Aug 24, 2022
Direct link to the article Manuel Matuzovic’s CSS Specificity Demo
specificity

Manuel Matuzovic’s CSS Specificity Demo

If you’re looking for a primer on CSS specificity, we’ve got that. And if you’re trying to get ahead of the game, you should be aware of CSS Cascade Layers as well.…

Chris Coyier on Feb 25, 2022
Direct link to the article Don’t Fight the Cascade, Control It!
:is :where cascade cascade layers custom properties data attributes specificity

Don’t Fight the Cascade, Control It!

If you’re disciplined and make use of the inheritance that the CSS cascade provides, you’ll end up writing less CSS. But because our styles often comes from all kinds of sources — and can be a pain to structure and …

Mads Stoumann on Jan 11, 2022
Direct link to the article An Interview With Elad Shechter on “The New CSS Reset”
interview reset specificity

An Interview With Elad Shechter on “The New CSS Reset”

Hey folks! Elad reached out to me to show me his new CSS reset project called the-new-css-reset. It’s quite interesting! I thought a neat way to share it with you is not only to point you toward it, but …

Elad Shechter on Feb 27, 2022
Direct link to the article Cascade Layers
@layer cascade specificity

Cascade Layers

There is a new thing coming in CSS: @layer. …

Chris Coyier on Jan 6, 2022
  • 1
  • 2
  • 3
  • Older

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

DigitalOcean
  • About DO
  • Cloudways
  • Legal stuff
  • Get free credit!
CSS-Tricks
  • Contact
  • Write for CSS-Tricks!
  • Advertise with us
Social
  • RSS Feeds
  • CodePen
  • Mastodon
  • Bluesky
Back to Top