Closed huntabyte closed 1 month ago
Latest commit: 5b6b2bbf916ec467c7dc330a57df74fc406a09d7
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Name | Status | Preview | Last Commit |
---|---|---|---|
runed | ✅ Ready (View Log) | Visit Preview | 5b6b2bbf916ec467c7dc330a57df74fc406a09d7 |
I feel like this might encourage relying on JS for styling instead of just the :focus-within
selector.
I feel like this might encourage relying on JS for styling instead of just the
:focus-within
selector.
The same could be said for the activeElement
instead of :focus
. The intentions aren't for it to be used for styling but rather side effects when focus is/isn't within a specific element which is useful.
If someone really wants to instantiate a class, bind to the reference of an element, and conditionally style something vs using the CSS selector then they have problems we're incapable of solving.
Also, there is a use case for styling where you want to style something that isn't the form element differently when the form element has focus within.
Also, there is a use case for styling where you want to style something that isn't the form element differently when the form element has focus within.
You can still use CSS for that.
Style a child
form:focus-within .some-selector
Style a sibling
form:focus-within + .some-selector
Style a parent
.some-selector:has(form:focus-within)
But yeah I get the other use case.
Tracks whether focus is within a given target element.
I also added testing library so we can test components.