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

Generate warning for reordering breakage #32

Open
splondike opened this issue Sep 8, 2014 · 0 comments
Open

Generate warning for reordering breakage #32

splondike opened this issue Sep 8, 2014 · 0 comments

Comments

@splondike
Copy link

There's at least one situation where CMQ can change the ordering of rules. Consider the following (we had some SCSS mixins which compiled to essentially this):

.my-class, .other-class {
    color: red;
}
@media(min-width: 100px) {
    .my-class, .other-class {
        color: blue;
    }
}

.my-class {
    color: green;
}
@media(min-width: 100px) {
    .my-class {
        width: 150px;
    }
}

CMQ will put both the media query blocks at the end of the file. As a consequence if the screen width >= 100px 'my-class' will be blue. Without CMQ the same screen size would result in green.

This is of course how CMQ is meant to work, but it would be nice to print a warning message in this case. It doesn't look like this would be easy unfortunately, as you would need to trace through the resultant attributes for each select/media query pair and see if anything differed between the original and changed file.

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

1 participant