Re: [csswg-drafts] [selectors] Declarative custom `:state()` states (#12502)

@LeaVerou My concern is that this seems to break encapsulation for custom element authors. The rule of not being able to remove a state isn’t enough and actually creates a potential mismatch between a custom element’s own styles and its own state (e.g. `:host(:state(on))` is no longer reliable). The lack of a state can be just as meaningful as the presence of a state, so not being able to set that is problematic. As a custom element author, I want the states I set to be reliable for my styling purposes (and for my consumers) because they accurately reflect the semantics I’m conveying.

-- 
GitHub Notification of comment by knowler
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/12502#issuecomment-3097047503 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 21 July 2025 14:35:28 UTC