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

cssnano mangles value if multiline with comment inside #81

Closed
MadLittleMods opened this issue Oct 16, 2015 · 4 comments
Closed

cssnano mangles value if multiline with comment inside #81

MadLittleMods opened this issue Oct 16, 2015 · 4 comments

Comments

@MadLittleMods
Copy link

I came across a very weird issue where when cssnano is enabled, it will stop other plugins from transforming the value.

The comment(/* some comment */) seems to be the messing with something as it works fine without it.

postcss([
    simplevariables(),
    cssnano()
]);

Input:

$color: #f00;

:root {
    box-shadow:
        inset 0 -10px 12px 0 $color,
        /* some comment */
        inset 0 0 5px 0 $color;
}

Expected:

:root {box-shadow: inset 0 -10px 12px 0 red,inset 0 0 5px 0 red}

Actual (wrong):

:root{box-shadow:inset 0 -10px 12px 0 $color,inset 0 0 5px 0 $color}
@MadLittleMods MadLittleMods changed the title cssnano mangles value if multiline with comment above cssnano mangles value if multiline with comment Oct 16, 2015
@MadLittleMods MadLittleMods changed the title cssnano mangles value if multiline with comment cssnano mangles value if multiline with comment inside Oct 16, 2015
@TrySound
Copy link
Collaborator

@MadLittleMods Seems like it's variables problem. They process first.

@MadLittleMods
Copy link
Author

@TrySound Just to be clear, the variables properly resolve when cssnano is disabled(commented-out). This also applies to any plugin that would do stuff to that value. It is as if cssnano is stopping the modification/resetting the value.

@ben-eb ben-eb closed this as completed Oct 16, 2015
@ben-eb
Copy link
Collaborator

ben-eb commented Oct 16, 2015

@MadLittleMods Fixed by postcss-discard-comments version 2.0.2.

@MadLittleMods
Copy link
Author

@ben-eb 👍 cssnano is now working properly with my styles. Thank you for taking care of this so promptly :)

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

No branches or pull requests

3 participants