saulhardman / postcss-hover-media-feature

PostCSS plugin that extracts and wraps rules containing `:hover` pseudo-classes in `@media (hover: hover) {}` media queries
MIT License
59 stars 5 forks source link

Recognizes Rules As Already Nested If `hover:hover` Misses The Space Char #33

Open analog-nico opened 1 year ago

analog-nico commented 1 year ago

This library does not add a media query if it is already present: @media (hover: hover) {.btn:hover {}}

But if there is NO SPACE between hover: and hover like this: @media (hover:hover) {.btn:hover {}}

...then we get: @media (hover:hover) { @media (hover: hover) {.btn:hover {}}}

I found a case in the DaisyUI code where they cannot use a space and hence I suspect that this scenario is relevant in more cases than just this one.