Skip to main content
CSS-Tricks
  • Articles
  • Alamanac
  • Guides
  • Videos
  • Books
  • Newsletter
Search

Articles Tagged
:where

8 Articles
{
,

}
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 …

Avatar of Geoff Graham
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 …

Avatar of Liam Johnston
Liam Johnston on Nov 21, 2022 (Updated on Jan 17, 2023)
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 …

Avatar of Mads Stoumann
Mads Stoumann on Jan 10, 2022 (Updated on Jan 11, 2022)
Direct link to the article @supports selector()
:where @supports cross-browser selectors

@supports selector()

I didn’t realize the support for @supports determining selector support was so good! I usually think of @supports as a way to test for property: value pair support. But with the selector() function, we can test for selector support …

Avatar of Chris Coyier
Chris Coyier on Oct 19, 2021
Direct link to the article Using the Specificity of :where() as a CSS Reset
:where specificity

Using the Specificity of :where() as a CSS Reset

I don’t know about you, but I write these three declarations many times in my CSS:

ul {
  padding: 0;
  margin: 0;
  list-style-type: none;
}

You might yell at me and say I can just put those in my CSS …

Avatar of Mojtaba Seyedi
Mojtaba Seyedi on Jul 12, 2021
Direct link to the article :where
:where

:where

The :where() pseudo selector in CSS is functionally identical to the :is() psuedo selector in that it takes a comma-separated list of selectors to match against, except that where :is() takes the most specific among them as the specificity of …

Avatar of Chris Coyier
Chris Coyier on Mar 23, 2021 (Updated on Jul 14, 2021)
Direct link to the article CSS :is() and :where() are coming to browsers
:is :where pseudo classes

CSS :is() and :where() are coming to browsers

Šime Vidas with the lowdown on what these pseudo-selectors are and why they will be useful:

  • :is() is to reduce repetition¹ of parts of comma-separated selectors.
  • :where() is the same, but nothing inside it affects specificity. The example of
…
Avatar of Chris Coyier
Chris Coyier on Jun 10, 2020
Direct link to the article :is
:is :where

:is

The pseudo-select :is() in CSS allows you to write compound selectors more tersely. For example, rather than writing:

ul li,
ol li {}

We could write:

:is(ul, ol) li {}
…
Avatar of Geoff Graham
Geoff Graham on Dec 21, 2017 (Updated on Dec 2, 2022)

CSS-Tricks is powered by DigitalOcean.

Keep up to date on web dev

with our hand-crafted newsletter

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