css / csso

CSS minifier with structural optimizations
https://css.github.io/csso/csso.html
MIT License
3.74k stars 189 forks source link

CSS error breaks optimization #479

Open PavelFil opened 4 months ago

PavelFil commented 4 months ago

Hello. This code can't be minified:

.marquee p:nth-child {
    color:red;
}

The error text:

/usr/lib/node_modules/csso-cli/node_modules/csso/cjs/restructure/prepare/specificity.cjs:80
                        const arg = node.children.first;

Online service https://css.github.io/csso/csso.html shows error too.

dryabov commented 4 months ago

How do you expect to minify this invalid CSS? Drop it entirely?

PavelFil commented 4 months ago

I think yes, drop it entirely is a best choose. This code can't be used by browsers.