Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support additional pseudo-elements with arguments? #33

Closed
philschatz opened this issue Feb 2, 2017 · 2 comments
Closed

Support additional pseudo-elements with arguments? #33

philschatz opened this issue Feb 2, 2017 · 2 comments

Comments

@philschatz
Copy link
Contributor

There are drafts for CSS extensions that use arguments to pseudo-element selectors (ie ::slotted(.foo) or ::before(2)) to allow additional information.

Rather than something like hardcoding lib/parser/type/PseudoElement.js#L20 what if:

  1. the parser allowed any pseudo-element to have optional arguments (instead of special-casing ::slotted(.foo)? or
  2. the css-tree constructor took an additional configuration option containing all the valid pseudoelements and whether arguments were forbidden, allowed, or required?

Thanks again for all the parsing work!

@lahmatiy
Copy link
Member

lahmatiy commented Feb 2, 2017

Yep, I thought about it, but had no any use case. I don't see any reason for any pseudo-element to be a functional-pseudo. Even it's not a standard yet ;)
I working on pseudos right now. So I'm going to do first point ;)

the css-tree constructor took an additional configuration option containing all the valid pseudoelements and whether arguments were forbidden, allowed, or required?

Yes, I believe it will be available later by setting custom consumer for pseudos, functions and at-rules. It's not ready yet, but it's likely to appear in future releases.

@lahmatiy
Copy link
Member

lahmatiy commented Feb 3, 2017

Available in 1.0.0-alpha4

@lahmatiy lahmatiy closed this as completed Feb 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants