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

Compile error with :is() selector #8

Closed Knovour closed 3 years ago

Knovour commented 3 years ago

Source

:is(button, [role="button"]):hover {
    background-color: transparent;
}

Run postcss btn.css -o out.css

Result

:is(button {
    background-color: transparent;
}@media (hover: hover) {[role="button"]):hover {
    background-color: transparent;
}
}

Expected

@media (hover: hover) {
  :is(button, [role="button"]):hover {
    background-color: transparent;
  }
}

It works ok when :hover is inside

:is(button:hover, [role="button"]:hover) {
    background-color: transparent;
}

Example

saulhardman commented 3 years ago

Hey @Knovour, thanks for the bug report :+1: I'm going to take a look at this now and get back to you ASAP. Thanks for your patience 😊

saulhardman commented 3 years ago

Hi again @Knovour, I've just pushed a new release (v1.0.1) – if you could test it and confirm that the fix has worked I'd very much appreciate it. Thanks in advance 🙂

Knovour commented 3 years ago

All working now, thank you!