Skip to content
New issue

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

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

Already on GitHub? # to your account

Selectors are moved above @import with restructuring on and --skip-import #476

Closed
buduchail opened this issue Mar 3, 2015 · 3 comments
Closed

Comments

@buduchail
Copy link

Seems like @import rules are not kept on top when restructuring. When skipping processing of @import rules and using advanced optimization with restructuring, some properties can end up above @import rules which are correctly at the top, thus breaking the generated CSS.

This CSS:

@charset "UTF-8";
@import url(http://fonts.googleapis.com/css?family=Lora:400,700);
a {
    width: 100px;
}
div {
    color: red;
}
.one {
    display: block;
}
.two {
    color: red;
    display: inline;
}

will end up as:

@charset "UTF-8";.two,div{color:red}@import url(http://fonts.googleapis.com/css?family=Lora:400,700);a{width:100px}.one{display:block}.two{display:inline}

instead of:

@charset "UTF-8";@import url(http://fonts.googleapis.com/css?family=Lora:400,700);.two,div{color:red}a{width:100px}.one{display:block}.two{display:inline}
@codeengie
Copy link

Glad I found this, thought I was going crazy when all my fonts broke. Thanks for the fix.

@jakubpawlowicz
Copy link
Collaborator

I'll merge and release it tomorrow morning. Sorry for the trouble - use restructuring: false in the meantime.

jakubpawlowicz pushed a commit that referenced this issue Mar 4, 2015
It is the same story as with `@charset`s and important comments.
jakubpawlowicz pushed a commit that referenced this issue Mar 4, 2015
It is the same story as with `@charset`s and important comments.
jakubpawlowicz pushed a commit that referenced this issue Mar 4, 2015
It is the same story as with `@charset`s and important comments.
@jlukic
Copy link

jlukic commented Mar 6, 2015

Just ran into this today with our dist files. Glad I found this thread. Thanks for the fix.

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

No branches or pull requests

4 participants