Coder Social home page Coder Social logo

Comments (5)

MoOx avatar MoOx commented on July 2, 2024

Does the spec allow that ? If so please make a PR :)

from postcss-custom-selectors.

neatonk avatar neatonk commented on July 2, 2024

It's not mentioned in the spec. That said, the @custom-selector grammar accepts a <selector> and allows the provided <custom-selector> to be used as a <selector> even though the grammar doesn't include it yet. It seems reasonable then to say that the <selector> in the @custom-selector grammar should accept any <custom-selector> as well.

I'm happy to put together a pull request if this sounds reasonable enough.

from postcss-custom-selectors.

MoOx avatar MoOx commented on July 2, 2024

We can ask @tabatkins for that since he is the author of the spec ;)

from postcss-custom-selectors.

neatonk avatar neatonk commented on July 2, 2024

Good call.

from postcss-custom-selectors.

tabatkins avatar tabatkins commented on July 2, 2024

Note that custom selectors are pseudo-classes, so it would be :--heading, etc.

But yeah, you can totes use custom pseudo-classes in the definitions of other custom pseudo-classes. You need to run a cycle detector, though, and mark all of the ones that are involved in the cycle as invalid (the rules themselves are valid, but they define a pseudo-class that matches nothing). This hasn't been put into the spec yet, but it matches what custom properties do.

from postcss-custom-selectors.

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.