csso
                                
                                 csso copied to clipboard
                                
                                    csso copied to clipboard
                            
                            
                            
                        Ignore parse errors
csso can't minify some legacy styles because of parse errors.
csso "styles.css" "styles.min.css"
Parse error X:\project\css\styles.css: Unexpected input
 3354 |.Notes {
 3355 | padding:0px
 3356 | display:block;
---------------^
 3357 | width:420px;
 3358 | float:right;
I understand that ignoring could slow parsing and I really need to fix all errors, but right now I don't need linting, my target is only minification.
Is there a way to ignore parse errors?
It's quite complicated to parse invalid CSS. Unfortunately, I can't say when it will be available. There is a related issue https://github.com/csstree/csstree/issues/16
And even if we'll parse broken CSS it's not clear what we should to do with wrong parts – remove, left as is or something else. Broken structure makes optimisations harder as well.
Sorry, didn't find that related issue.
it's not clear what we should to do with wrong parts
I think we can remove them, like browsers do. We don't need garbage in optimized code.
Yep, it looks reasonable. But if optimizer would removes some parts of CSS silently it might be a source of problems. Some parts may to be wrong, but others may to be correct but parser/optimizer just can't understand them. I don't know good enough solution for this problem yet.
I would welcome some solution like in clean-css which uses /* clean-css ignore:start */ and /* clean-css ignore:end */.