-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:blank
pseudo-selector support (re form fields)
#179
Comments
I also can't find any tests. All matches for |
Implementation bugs: None found for WebKit. |
This seems like a reasonable feature, but the HTML standard needs to define how this actually works for its various elements. As far as I can tell that work hasn't been done. E.g., does this work for |
@annevk Good call out! Sharing some thoughts in the related issue you opened. Thanks! |
Would :blank apply when placeholder is set? |
In the State of CSS 2022 question about browser incompatibilities, there were no mentions of (I'm not commenting on all proposals where there wasn't any signal from State of CSS, but thought I would here because it's similar to #180 where I did comment.) |
In the MDN short survey on CSS & HTML, "CSS Since |
Thank you for proposing the :blank pseudo-selector for inclusion in Interop 2023. We wanted to let you know that this proposal was not selected to be part of Interop this year. The specifications for For an overview of our process, see the proposal selection summary. Thank you again for contributing to Interop 2023! Posted on behalf of the Interop team. |
@foolip @nairnandu Could we look into resurrecting this one for Interop 2024 as well? |
I'm not convinced we have seen enough progress on w3c/csswg-drafts#1967 and whatwg/html#8451. |
@annevk Fair point. whatwg/html#8451 seems pretty thorough to me, but w3c/csswg-drafts#1967 may still require further discussion. |
Description
:blank
is a pseudo-selector that allows CSS to target a form field when it is blank/unpopulated.Quoting the spec:
Rationale
There's currently no viable way to target a blank form field. The most common vanilla workaround for this so far is to mark the field as
required
and then check for:valid
along with somepattern
matching, however there are quite a few fundamental problems with that approach:More recently, another workaround for this that has been growing in popularity is
:placeholder-shown
but this doesn't appear to work when there is noplaceholder
set.Related discussions:
Specification
https://w3c.github.io/csswg-drafts/selectors-4/#blank
Tests
Struggling to find any tests
The text was updated successfully, but these errors were encountered: