[selectors] Consider adding a selector to match the element that has shadow DOM
Open
Nobody has claimed this yet.
selectors-4
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
Add the following code to remind users that the undefined elements are used:
:not(:defined) {
display: block;
font-size: 0;
}
:not(:defined) * {
display: none;
}
:not(:defined)::before {
font-size: 1rem;
display: block;
content: 'The element is not defined';
padding: 1em;
text-align: center;
background: gray;
}
But now we have Declarative Shadow DOM, we can no longer determine which elements may have layout problems(demo), to find these elements, it is suggested to add a pseudo class::attached:
:not(:defined, :attached) {
display: block;
font-size: 0;
}
:not(:defined, :attached) * {
display: none;
}
:not(:defined, :attached)::before {
font-size: 1rem;
display: block;
content: 'The element is not defined';
padding: 1em;
text-align: center;
background: gray;
}
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
Review the proposed :attached pseudo-class alongside the linked Declarative Shadow DOM discussion in WHATWG DOM issue 831 and the provided demo. Determine the selector’s intended behavior for elements with shadow DOM, then document the specification changes and validation needed; no repository files or tests are named in the issue.
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
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100