July 24, 2019 06:04 pm GMT
Original Link: https://css-tricks.com/dont-comma-separate-focus-within-if-you-need-deep-browser-support/
Dont comma-separate :focus-within if you need deep browser support
I really like :focus-within
. It's a super useful selector that allows you to essentially select a parent element when any of its children are in focus.
Say you wanted to reveal some extra stuff when a <div>
is hovered...
div:hover { .extra-stuff { /* reveal it */ }}
That's not particularly keyboard-friendly. But if something in .extra-stuff
is tab-able anyway (meaning it can be focused), that means you could write it like this to make it a bit … Read article
The post Don’t comma-separate :focus-within if you need deep browser support appeared first on CSS-Tricks.
Original Link: https://css-tricks.com/dont-comma-separate-focus-within-if-you-need-deep-browser-support/
Share this article:
Tweet
View Full Article