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‑shadow‑parts] What is the specificity of ::part(…) with multiple <ident>s? #3995

Open
ExE-Boss opened this issue Jun 2, 2019 · 4 comments

Comments

@ExE-Boss
Copy link
Contributor

ExE-Boss commented Jun 2, 2019

https://drafts.csswg.org/css-shadow-parts/#part

Since the part name is similar to a class name, I would expect that ::part(active tab) would have a higher specificity than ::part(tab) or ::part(active).


See also: #1915, #3502, WICG/webcomponents#847

@tabatkins
Copy link
Member

Sounds reasonable, but do we want this to interact class-like with real classes?

That is, do the following have the same specificity, so the result is solely determined by order?

.foo::part(tab) {color: blue;}
::part(active tab) {color: red;}

@emilio
Copy link
Collaborator

emilio commented Oct 11, 2019

I think I'd rather keep it working as a regular pseudo-element selector than complicating the specificity rules, but that's just my opinion :)

@ExE-Boss
Copy link
Contributor Author

Sounds reasonable, but do we want this to interact class-like with real classes?

That is, do the following have the same specificity, so the result is solely determined by order?

.foo::part(tab) {color: blue;}
::part(active tab) {color: red;}

Well, .foo selects the shadow host in the light tree, whereas ::part(active tab) selects the part in the shadow tree, so ¯\_(ツ)_/¯.

@emilio
Copy link
Collaborator

emilio commented Oct 11, 2019

I don't think that matters? Both can end up matching the same element, so they need to be sorted by specificity and thus tab's question still stands.

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

4 participants