DEV Community

Discussion on: Applying CSS :focus-within

cydstumpel profile image

Yasss I love focus-within, I discovered one bug though. I usually use focus within to show the same state as hover so I use it like this:

.ul {
  &:focus-within, &:hover {
    // code to show sub nav or something

On edge though, not only is focus-within not supported, but it actually breaks the hover state! 🤯
You have to add the hover on a separate line and shouldn’t use focus-within in combination with other selectors; as in comma separated on the same line.

junicodefire profile image
Okechukwu Obi

Is this not saas

lauragift21 profile image
Gift Egwuenu Author

Oh really. I didn't know about this but thanks for sharing it.