csso icon indicating copy to clipboard operation
csso copied to clipboard

Take in account selectors support in functional pseudo-classes

Open lahmatiy opened this issue 3 years ago • 0 comments

Currently CSSO doesn't traverse selectors in functional pseudo-classes when build pseudoSignature which leads to the incorrect merge of rules, e.g.

.cc-expiry-month:not(:-moz-placeholder-shown) {
      width: 42px;
}

.cc-expiry-month:not(:-ms-input-placeholder) {
      width: 42px;
}

.cc-expiry-month:not(:placeholder-shown) {
      width: 42px;
}

Will produce the incorrect result (pretty printed):

.cc-expiry-month:not(:-moz-placeholder-shown),
.cc-expiry-month:not(:-ms-input-placeholder),
.cc-expiry-month:not(:placeholder-shown){
    width:42px
}

The correct output should not merge rules.

(example taken from the comment in #416)

lahmatiy avatar Jan 26 '22 08:01 lahmatiy