-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
@import (css) "file.css" puts the css at the top of the output #2440
Comments
Hrmm, its always been like this it looks like. Its caused by the code https://github.com/less/less.js/blob/master/lib/less/tree/ruleset.js#L338 Looking at the history, It seems the logic over separating rulesets and rules is quite old. I am wondering how much is valid. Surely all we want to do is a) float imports statements above non comment statements b) float charsets above everything. Can you think of any reasons why anything else needs to be moved around? If we are not in root, what would need moving? I'm in the process of refactoring it out and looks like all existing tests would still pass.. |
I'm pretty sure nothing except what you listed needs to be moved. The only weird thing is probably:
but I guess this can be left as-is (just as it is now) because this code does not make any sense after all. |
So, to clarify, is the bug simply that the @seven-phases-max For your last example, I agree it probably doesn't need to be moved as we can't really know what the intent was of that invalid code. However it might be nice if any non-hoistable css |
Yep.` |
Boom, @lukeapage already fixed it (in accordance to prophecy). |
I am closing this, because it seem to be fixed by last two commits. |
I made a pr to see if anyone saw any problems. This will be closed automatically be the commit message when its merged. |
@lukeapage Sorry, missed that it is pull request not a commit. I looked at the changes do not see problem with the pull request you made. I can not think of a reason why anything except charset and import should be moved. |
Take the following less file, call it style.less:
Look at the generated style.css then I see bootstrap css file at the top, followed by the comments.
How do I fix it? Thanks in advance.
The text was updated successfully, but these errors were encountered: