Giter VIP home page Giter VIP logo

Comments (2)

sabberworm avatar sabberworm commented on May 2, 2024

No, there is no such thing (assuming I’m understanding you correctly). That’s mostly because selectors are (apart from being split at the comma) not really parsed at all and thus, very fragile. Selectors are also not normalized, so searching for #test > a will not yield any results when your selector is #test>a.
Parsing selectors is high on my would-really-improve-the-quality-of-the-software list (especially as it would help me get rid of a lot of bugs such as the selector a[href~="{"] yielding a parse error since CSSParser doesn’t know that the { is not really the start of a declaration block but instead part of the selector) but unfortunately, it’s not high on the list of priorities because parsing selectors is difficult and I’ve never needed it in any of my projects.
That being said, however, feel free to fork the project, add a utility method to CSSDocument or CSSList that iterates through all declaration blocks and returns the ones where one of the selectors matches a given pattern and I’ll merge your changes.

from php-css-parser.

sabberworm avatar sabberworm commented on May 2, 2024

I’m closing this as there has not been a response to my WONTFIX-type answer…

from php-css-parser.

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.