Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"merge components into shorthand properties" (level 2) causes invalid repetition of !import #1032

Closed
pocketjoso opened this issue Jun 2, 2018 · 1 comment
Labels

Comments

@pocketjoso
Copy link

pocketjoso commented Jun 2, 2018

Hi again, continuous thanks for providing this excellent library! Long time since I last found a bug, but here's a new one, hoping it will be easy to fix. :)

Environment

  • clean-css version - npm ls clean-css:
    clean-css@4.1.11. Also reproduced via online demo (https://jakubpawlowicz.github.io/clean-css/)
  • node.js version - node -v:
    10.0.0 (also online demo)
  • operating system:
    MacOS (also online demo)

Configuration options

I run with level: 2, but I broke it down more specifically to the merge components into shorthand properties being responsible, via the online demo.

Input CSS

div {
    border-color: currentColor!important;
    border-radius: 0!important;
    border-style: none!important;
    border-width: medium!important;
    list-style-type: inherit!important;
    list-style-position: outside!important;
    list-style-image: none!important;
}

Actual output CSS

div{border-radius:0!important;border:currentColor!important!important!important;border:currentColor!important!important!important;border:currentColor!important!important!important;list-style:outside;list-style-type:inherit!important}

This broken rule repeats badly, taking up more and more space the larger the file. It made the original css file about 3 times larger than before clean-css (before I pruned it for debugging and presenting here).

Expected output CSS

Haven't reviewed this with 100% certainty; the main thing is just to not have the incorrect !important!important.. repetition. But it also seems that there is a missing important on the list-style property.

div{border-radius:0!important;border:currentColor;list-style:outside!important;list-style-type:inherit!important}
@pocketjoso pocketjoso changed the title "merge components into shorthand properties" causes invalid repetition of !import "merge components into shorthand properties" (level 2) causes invalid repetition of !import Jun 2, 2018
@pocketjoso
Copy link
Author

pocketjoso commented Jul 14, 2018

Hi, I don't want to be annoying, just want to ask if you have had a chance to look at this at all? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants