Brian Zelip
Brian Zelip

Reputation: 3191

Jekyll Sass converter ignores @charset

Jekyll's Sass converter is ignoring the @charset "UTF-8"; declaration at the very beginning of style.scss file after compiling to css.

You can see that this is true by comparing the following files:

  1. the Sass file with @charset: https://github.com/brianzelip/brianzelip.github.io/blob/master/css/style.scss
  2. the compiled css file without @charset: https://github.com/brianzelip/brianzelip.github.io/blob/master/_site/css/style.css

The problem is happening both on my local machine and via Github pages.

How to keep the @charset rule after compiling?

Upvotes: 0

Views: 333

Answers (1)

David Jacquel
David Jacquel

Reputation: 52789

Sass keeps the @charset declaration only if needed (non-ASCII character in your file).

Anyway, you file will be utf-8 as sass first checks the Unicode byte order mark, then the @charset declaration, then the Ruby string encoding. If none of these are set, it will assume the document is in UTF-8. Sass documentation

Upvotes: 0

Related Questions