postcss / postcss-selector-matches

PostCSS plugin to transform :matches() W3C CSS pseudo class to more compatible CSS (simpler selectors)
MIT License
44 stars 10 forks source link

Strange output with custom selector and :matches() #3

Closed ntharim closed 9 years ago

ntharim commented 9 years ago

An example:

@custom-selector :--buttons button, .button;

 :--buttons:matches(:hover, :active) {
  display: none;
 }

postcss-custom-selectors would generate:

button:matches(:hover, :active),
.button:matches(:hover, :active) {
  display: none;
 }

From this, postcss-selector-matches would generate:

button:hover, .button:hover, button:active, .button:hover, button:hover, .button:active, button:active, .button:active {
  display: none;
}

Shouldn't the output be close to something like this instead?

button:hover, button:active, .button:hover, .button:active {
  display: none;
}

This gets worse if you're trying to match at lot of things like :matches(:hover, :active, :focus, .active).

MoOx commented 9 years ago

Fix released as 1.1.1