W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2020

Re: [csswg-drafts] [css-selectors] Make <label> elements reflect CSS pseudoclasses on associated form element (#397)

From: Sebastian Zartner via GitHub <sysbot+gh@w3.org>
Date: Tue, 01 Dec 2020 21:27:35 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-736831335-1606858054-sysbot+gh@w3.org>
I am strongly opposed to let labels directly reflect the pseudo-classes of the associated form control.

1. The state of the form control doesn't apply to the label. E.g. it's the form control that is focused, not the label.
2. Letting pseudo-classes behave differently depending on whether they are prepended by `label` or not is confusing.
3. Letting the pseudo-classes apply to labels now may break existing websites.

Therefore, solving this use case via a pseudo-class function like `:for()` as discussed in #1067 is much more logical, in my eyes. Furthermore a function like that has the advantage of being extensible and covering more than just form control states.

Sebastian

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Tuesday, 1 December 2020 21:27:57 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:23 UTC