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

The @charset rule should appear at the very beginning of the generated file #35

Closed
ghost opened this issue Aug 15, 2012 · 1 comment
Closed

Comments

@ghost
Copy link

ghost commented Aug 15, 2012

Hi,

I have a CSS file with comments written with accentuated characters (file encoded in UTF-8) and though I declared the charset to use as UTF-8 with the at-rule @charset, in the browser view source function, characters are misinterpreted.

Here's an example CSS:

@charset "UTF-8";

/**
    @author Marc-André Joyal
    @date 15 août 2012

*/

root { 
    display: block;
}

And the generated CSS from the view source function:

/*
 * CSS Crush(ed) on 2012-08-15 14:56:58 -0400
 * http://github.com/peteboere/css-crush (v1.6.0)
 */
@charset "UTF-8"
;/**
    @author Marc-André Joyal
    @date 15 août 2012

*/

root {
    display: block;
    }

As per the W3C documentation, the charset at-rule should appear at the very start of the document.

Best Regards

@peteboere
Copy link
Owner

Yep, I'll definitely look at getting this fixed.

In the meantime you can disable the output boilerplate so the charset directive is before anything else.

peteboere added a commit that referenced this issue Aug 22, 2012
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