Skip to content
This repository has been archived by the owner on Oct 26, 2021. It is now read-only.

Docs should note that :defined is not supported #110

Closed
arthurevans opened this issue Sep 1, 2017 · 3 comments
Closed

Docs should note that :defined is not supported #110

arthurevans opened this issue Sep 1, 2017 · 3 comments

Comments

@arthurevans
Copy link

May be obvious to some, but was not to me. For native custom elements, can use the :defined pseudo-class to style elements that have been defined (and probably more importantly, :not(:defined) to style elements that haven't been).

Current fix I believe is to manually add and remove an "unresolved" attribute, or equivalent.

@valdrinkoshi
Copy link
Contributor

for completeness, the unresolved trick won't work for those elements that get upgraded lazily (e.g. after some user action). The unresolved attribute styling is done in webcomponentsjs, and the attribute is removed after at WebComponentsReady event.

@notwaldorf
Copy link

I think Arthur meant literally removing it manually, in the importHref callback, like how Shop does it.

@snuggs
Copy link
Contributor

snuggs commented Sep 10, 2017

Salut! @notwaldorf @valdrinkoshi @arthurevans well done on documenting :defined. We are currently working through some inconsistencies between W3C/CSSOM/WHATWG. :defined and it's pseudo-class definition implementation are also under discussion along with some outstanding CE issues:

WICG/webcomponents#664
WICG/webcomponents#665

This also could shed light on some inconsistencies with Shady re: shadow DOM impl.
WICG/webcomponents#661

Just a heads up. Happy Sunday!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants