Closed
Conversation
14 tasks
Contributor
|
The :has() selector is not enabled in Firefox https://developer.mozilla.org/en-US/docs/Web/CSS/:has#browser_compatibility |
Member
Author
Contributor
|
i like it. 👌 the min-height for foating-labels textarea's could also be increased a little. then it's perfect. |
Member
louismaximepiton
left a comment
There was a problem hiding this comment.
I feel really exciting using this :has selector, however I feel like 85% might not be enough. For example I can't test it on FF LTS v.102. I don't know what's the policy on these features atm.
If we agree that we enable progressive enhancement, should we have a fallback ?
| position: relative; | ||
|
|
||
| &:not(.form-control:disabled)::before { | ||
| &:has(.form-control:not(:disabled))::before { |
Member
Member
Author
|
Another option in #38313. |
Member
Author
|
Closing for #38313. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This rewrites the selector to use
:has()because.form-floatingis a parent container, which has no:disabledstate. The:disabledis handled on the individual form element.That said, it'd be really cool if adding a
disabledattribute on a parent element would disabled all the elements within—right now only fieldsets do that. And I genuinely just stumbled back into thinking about this... so what if we used fieldsets here in v6? Something to think about.Anyway, the downside of using the
:has()selector is browser compatibility right now. I'm not super worried about that as this could be seen as a progressive enhancement, but it's worth calling out. With the new selector, nothing is generated for disabled fields, so we avoid that problem entirely./cc @julien-deramond @louismaximepiton @jonnysp