-
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
@charset reordered #2013
Labels
Comments
Hrmm they are moved to the top, but so are css imports and that looks like |
👍 hit me too ): |
SomMeri
pushed a commit
to SomMeri/less-rhino.js
that referenced
this issue
Jul 22, 2014
The genCss method of ruleset.js splits child nodes into two groups: * rules, * rulesets. Rules are always printed first and have special handling for last rule. Rulesets are always printed second. Wrong ordering was caused by the condition that determined what is rule and what is ruleset. Issue less#2013: The condition made no difference between @charset and @page, because both are compiled into tree.Directive nodes. I added isRulesetLike method to the tree.Directive to differentiate between them. Issue less#1954: The condition treated all tree.Anonymous types as rules and caused them to float up. That is incorrect, because `@import (inline)` is compiled into tree.Anonymous too, but should be treated as ruleset and stay where it is.
This was fixed by the merged pull request. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As per W3C:
It is important to understand that, although the @charset declaration looks like a CSS at-rule, it is not parsed as such for detection of the character encoding. Only an exact byte sequence, beginning with the very first byte in the style sheet, will be effective.
However:
Results in:
Why @charset is suddenly placed after other directives even if it's the first in the input file? (For this matter LESS should have moved it to the first line even if it wasn't there to be W3C-compliant.)
Am I missing something?
The text was updated successfully, but these errors were encountered: