Thanks @Keith, I was wondering if you might confirm something for me: 1. The first is that you can only use this feature with autonomous custom elements (only custom elements that don't derive from built-ins). I tried doing a built in and got a DOMException as described here: https://github.com/whatwg/html/issues/5166 2. The spec example 1 says "Assume that LabeledCheckbox doesn’t expose its "checked" state via a content attribute.". My assumption is that if it did so you just select in the normal way? (i.e. ``` mycomponent[checked] { /* styles here */ } ``` So if you don't want the state set externally, I guess like hover, then you could use the state to expose that "privately"? Or to put it another way, I'm still trying to understand the use case where you'd really want to use this.
Bug 1861466 Comment 9 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Thanks @Keith, I was wondering if you might confirm something for me: 1. The first is that you can only use this feature with autonomous custom elements (only custom elements that don't derive from built-ins). I tried doing a built in and got a DOMException as described here: https://github.com/whatwg/html/issues/5166 2. Is there a right way to set a custom element to be a block element "by default"? (for the spec example it is inline by default). 3. The spec example 1 says "Assume that LabeledCheckbox doesn’t expose its "checked" state via a content attribute.". My assumption is that if it did so you just select in the normal way? (i.e. ``` mycomponent[checked] { /* styles here */ } ``` So if you don't want the state set externally, I guess like hover, then you could use the state to expose that "privately"? Or to put it another way, I'm still trying to understand the use case where you'd really want to use this.
Thanks @Keith, I was wondering if you might confirm something for me: 1. The first is that you can only use this feature with autonomous custom elements (only custom elements that don't derive from built-ins). I tried doing a built in and got a DOMException as described here: https://github.com/whatwg/html/issues/5166 2. Is there a right way to set a custom element to be a block element "by default"? (for the spec example it is inline by default). 3. The spec example 1 says "Assume that LabeledCheckbox doesn’t expose its "checked" state via a content attribute.". My assumption is that if it did so you just select in the normal way? (i.e. ``` mycomponent[checked] { /* styles here */ } ``` So if you don't want the state set externally, I guess like hover, then you could use the state to expose that "privately"? Or to put it another way, I'm still trying to understand the use case where you'd really want to use this. The current docs and even the spec are very much "hey you can do this cool thing" but not so clear why you would bother.
Thanks @Keith, I was wondering if you might confirm something for me: 1. The first is that you can only use this feature with autonomous custom elements (only custom elements that don't derive from built-ins). I tried doing a built in and got a DOMException as described here: https://github.com/whatwg/html/issues/5166 2. The spec example 1 says "Assume that LabeledCheckbox doesn’t expose its "checked" state via a content attribute.". My assumption is that if it did so you just select in the normal way? (i.e. ``` mycomponent[checked] { /* styles here */ } ``` So if you don't want the state set externally, I guess like hover, then you could use the state to expose that "privately"? Or to put it another way, I'm still trying to understand the use case where you'd really want to use this. The current docs and even the spec are very much "hey you can do this cool thing" but not so clear why you would bother.
Thanks @Keith, I was wondering if you might confirm something for me: 1. You can only use this feature with autonomous custom elements (only custom elements that don't derive from built-ins). I tried doing a built in and got a DOMException as described here: https://github.com/whatwg/html/issues/5166