[selectors] Partial element selectors
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
Link: https://www.w3.org/TR/2018/WD-selectors-4-20181121/
With the advent of custom elements and the growing popularity of web component libraries (especially those with common prefixes), the need for a way to target a tag selector using attribute match syntax has increased.
Use case
I have library x with a set of components: x-foo, x-bar, x-bat. I want to write styles influence only those components on the page but I'm not sure which components are in use.
Suggestions
In this thread, a few ideas were proposed: https://twitter.com/castastrophee/status/1433418836364210182?s=20
I'll do my best to summarize:
- Add support for wildcard syntax with selectors, i.e.
x-* { color: red; }. - Add support for wildcard syntax inside the
:is()pseudo-selector i.e.:is(x-*) - Add a tag or tagName attribute that can be queried i.e.,
[tag^="x-"]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Selectors Level 4 draft and the discussion linked in this issue; compare the three proposed syntaxes and their implications for custom-element names. Done means the CSS Working Group has selected and specified a supported approach, with the relevant draft text updated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100