yui / yuicompressor

YUI Compressor
http://yui.github.com/yuicompressor/
Other
3.01k stars 661 forks source link

Space before : are removed inside media query #334

Open rczobor opened 4 years ago

rczobor commented 4 years ago

Version 2.4.8 removes spaces in css selector when inside a media (or @supports) query:

@media screen and (-ms-high-contrast: none) {
    body :focus {
      outline: 2px solid #5e9ed6;
    }
}

The space before : is removed and changing the selector.

@media screen and (-ms-high-contrast: none) {
    body:focus {
      outline: 2px solid #5e9ed6;
    }
}

The space before : should not be removed.

suminas85 commented 2 years ago

Hi @nethzyr The same for me even with asterisk.

@media ... { .content :not(...) { ... } } or @media ... { .content *:not(...) { ... } }

After compressing: @media ...{ .content:not() { ... } }

UPD: temporary solution is to use " " @media ... { .content * *:not(...) { ... } }

After compressing: @media ... { .content * :not(...) { ... } }

melloware commented 2 years ago

Fixed in my fork: https://github.com/primefaces-extensions/resources-optimizer-maven-plugin/commit/80679c55570c2ff146fc6b0b00b601c855e3a844