MadLittleMods / postcss-css-variables

PostCSS plugin to transform CSS Custom Properties(CSS variables) syntax into a static representation
https://madlittlemods.github.io/postcss-css-variables/playground/
Other
540 stars 62 forks source link

wrong media query order #53

Closed iapYang closed 7 years ago

iapYang commented 7 years ago

Thanks for your work. Recently I've been using this plugin, It worked well but some error occurs.

Here is my original code:

:root {
    --color: green; 
}

div {
    color: var(--color);
}

@meida (max-width: 10000px) {
    :root {
        --color: red;
    }
}

@meida (max-width: 1000px) {
    :root {
        --color: yellow;
    }
}

and I used playground output is:

div {
    color: green;
}

@meida (max-width: 1000px) {

    div {
        color: yellow;
    }
}

@meida (max-width: 10000px) {

    div {
        color: red;
    }
}

The media query order is a in a wrong one, is that something can be fixed?

Thanks!~

MadLittleMods commented 7 years ago

Duplicate of https://github.com/MadLittleMods/postcss-css-variables/issues/30