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

[css-scoping] ::slotted should skip direct children with display: contents #6414

Open
jpzwarte opened this issue Jun 30, 2021 · 3 comments
Open
Labels
css-scoping-1 Current Work

Comments

@jpzwarte
Copy link

jpzwarte commented Jun 30, 2021

When creating web components/custom elements, the ::slotted pseudo element is very useful for styling slotted children. However, if such a child has display: contents, even though that child has no "presence" in the browser, the ::slotted styling is still applied to it, instead of the children of the display: contents element.

Please change the behavior so ::slotted skips any direct children with display: contents.

<h4 id='slotted-pseudo'>

@emilio
Copy link
Collaborator

emilio commented Jun 30, 2021

Changing how a selector matches based on computed styles is quite tricky. What if you set display: contents on an slotted selector?

@fantasai fantasai added the css-scoping-1 Current Work label Sep 1, 2021
@LeaVerou
Copy link
Member

Changing how a selector matches based on computed styles is quite tricky.

Agreed, though there should not be visible styling if the slotted element has display:contents, and it sounds like there is.

@jpzwarte
Copy link
Author

It's been a while, but iirc I'm not suggesting a display: contents suddenly has visible styling. Reading this again, I tend to agree that it is a not valid issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-scoping-1 Current Work
Projects
None yet
Development

No branches or pull requests

4 participants