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

Encoding issue with code literals (again) #2474

Closed
sinuhepop opened this issue Sep 12, 2017 · 2 comments
Closed

Encoding issue with code literals (again) #2474

sinuhepop opened this issue Sep 12, 2017 · 2 comments

Comments

@sinuhepop
Copy link

sinuhepop commented Sep 12, 2017

I have an encoding issue with different implementations of libsass. For example, writing:

$var: "\f045"; 
.c1 { content: $var; } 
.c2 { content: "\f045"; }

And I get:

@charset "UTF-8";
.c1 { content: ""; }
.c2 { content: "\f045"; }

So it seems that this problem appears when using variables. It is very similar to other issues (1, 2, 3, 4) already solved.

I tried with different implementations: libsass-maven-plugin, jsass and node-sass.

@mgreter
Copy link
Contributor

mgreter commented Sep 12, 2017

This is the way how ruby sass does it, and libsass tries to mimic ruby sass behavior whenever possible. The .c2 case is not changed to a unicode code-point because it's a static optimization by ruby sass (input is keept untouched). If you think this is a bug, please open an issue on upstream ruby sass directly. I think there is already a similar ticket open to get rid of the static optimization, since it also complicates other cases (like trailing semicolons etc.).

$var: "\f045"; 
.c1 { content: $var; } 
.c2 { content: "\f045"; }
.c3 { content: ("\f045"); }
@charset "UTF-8";
.c1 { content: ""; }
.c2 { content: "\f045"; }
.c3 { content: ""; }

@sinuhepop
Copy link
Author

@mgreter: You are right, it's how Sass works. In fact, this is a bug of the library I'm using: FortAwesome/Font-Awesome#10842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants