Closed KonnorRogers closed 1 month ago
Can you elaborate/show some examples/documentation?
@thepassle
/**
* @state open - When the element is open
*/
class MyEl extends HTMLElement {
constructor () {
super()
this.internals = this.attachInternals()
}
open () {
this.internals.states.add("open")
}
}
Example of CSS Custom states:
my-el { display: none; }
my-el:state(open) {
display: block;
}
Also open to @customState
since @state
can be confused with the decorator from Lit
I think we should go with @csscustomstate
or @cssstate
to align with @csspart
and @cssproperty
Works for me.
@cssstate
scared me because it seems really easy to typo.
Why not @internalstate ?
because its not consistent with @csspart
and @cssproperty
Would it be possible to add a tag for
@state
to document CSS Custom States?