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

CSS variable declarations in media queries produce duplicate nested output #64

Closed
jhildenbiddle opened this issue Nov 22, 2017 · 2 comments
Labels

Comments

@jhildenbiddle
Copy link

Input:

@media screen and (min-width: 480px) {
    :root {
        --color: blue;
    }
    
    body {
        background: var(--color);
    }
}

Expected:

@media screen and (min-width: 480px) {
    body {
        background: blue;
    }
}

Actual output:

@media screen and (min-width: 480px) {
    
    body {
        background: blue;
    }
    
    @media screen and (min-width: 480px) {
    
        body {
        background: blue;
        }
    }
}

Reproducible using postcss-css-variables Playground.

@jhildenbiddle jhildenbiddle changed the title CSS variable declaration in media queries produce duplicate nested output CSS variable declarations in media queries produce duplicate nested output Nov 22, 2017
@nolimit-developers
Copy link

Hello, @jhildenbiddle , will try this plugin https://github.com/hail2u/node-css-mqpacker :) It would be best if the css input was written in OOCSS.

@MadLittleMods
Copy link
Owner

Closing in favor of #67

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

3 participants