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

Allow a list of content in :contains() #115

Closed
facelessuser opened this issue Feb 22, 2019 · 2 comments
Closed

Allow a list of content in :contains() #115

facelessuser opened this issue Feb 22, 2019 · 2 comments
Labels
C: css-custom CSS custom selectors. T: feature Feature.
Milestone

Comments

@facelessuser
Copy link
Owner

facelessuser commented Feb 22, 2019

The :contains() selector came about a long time ago and was abandoned in the CSS spec. We currently mimic contains as it was described originally.

It is important to note if that since the original spec is dead, there will be no updates. I imagine, if :contains() did not die way back when, that it is not impossible to think it would have been expanded to allow a comma-separated list of content: p:contains("some text", "some other text").

As :contains() currently supports valid identifiers or quoted values, a comma-separated list would contains a list of valid identifiers or quoted values. :contains() would match if any of the the items in the list match.

With things like :not() and :lang() moving towards comma-separated lists, and new functional selectors supporting comma-separated lists out of the box (except for a things like :nth-child(), :dir(), etc.), I think this evolution for :contains() makes sense.

@facelessuser facelessuser added T: feature Feature. selectors C: css-custom CSS custom selectors. P: maybe Pending approval of low priority request. labels Feb 22, 2019
@facelessuser
Copy link
Owner Author

As an aside, should we be specifying all of our custom selectors with :-? Should :contains() be moved over to :-contains() (with a deprecation path of course)?

@facelessuser facelessuser removed the P: maybe Pending approval of low priority request. label Feb 24, 2019
@facelessuser
Copy link
Owner Author

Adding lists is one of the most sane proposals for :contains(). As stated before, this seems like a logical progression that it seems CSS would have naturally taken had :contains() been included in the official specification. So we will implement this and mention how our :contains() differs from the original implementation proposal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: css-custom CSS custom selectors. T: feature Feature.
Projects
None yet
Development

No branches or pull requests

1 participant