Git Product home page Git Product logo

Comments (4)

robsonsobral avatar robsonsobral commented on July 3, 2024 3

From MDN:

However, selectors inside :where() have specificity 0[...]

This way, it's easier to override the styles.

from sanitize.css.

baticodes avatar baticodes commented on July 3, 2024 2

@robsonsobral agree on this, but then browser support should be updated in README since it's not supported by IE

from sanitize.css.

timbomckay avatar timbomckay commented on July 3, 2024 2

Upon further review, I see there are declarations such as :where(nav) :where(ol) to provide nested styles and can see how specificity can become a concern and using :where() just as a standard across the stylesheets.

from sanitize.css.

timbomckay avatar timbomckay commented on July 3, 2024

I'm a little curious if either are more performant. I understand it probably wouldn't have a noticeable difference but still like to know those things.

Is the main benefit that by dropping the specificity it doesn't matter where this is included in the cascade? Because now with this code

h1 { color: red; }
:where(h1) { color: blue; }

the color will remain red in the event that sanitize was loaded after other declarations? Otherwise I feel like they're already pretty easy to override as long as the cascade is structured correctly.

from sanitize.css.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.