DEV Community

Discussion on: Applying CSS :focus-within

Collapse
 
cydstumpel profile image
Cyd

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.

Collapse
 
junicodefire profile image
Okechukwu Obi

Is this not saas

Collapse
 
lauragift21 profile image
Gift Egwuenu

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