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

complier converts scss hex value to unicode character in css #39

Closed
lbj opened this issue Mar 5, 2021 · 1 comment
Closed

complier converts scss hex value to unicode character in css #39

lbj opened this issue Mar 5, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@lbj
Copy link

lbj commented Mar 5, 2021

The following code in my _style.scss file:

       content: '\25BC';
.... }

becomes :

       content: "▼";
.... }

when compiled to css.
Is there any way to prevent this? (Version v4.4.1 running on VS code on windows 10)

@glenn2223
Copy link
Owner

glenn2223 commented Mar 5, 2021

This is a known issue (ref here Edit: better ref)

There is a workaround here (as per below)

SCSS

@function unicode($str)
{
  @return unquote("\"")+unquote(str-insert($str, "\\", 1))+unquote("\"");
}

.icon-ok {
    &:before {
      content: "\e601"; // BROKEN
    }
    &:after {
      content: unicode("e601"); // WORKS
    }
}

SASS

@function unicode($str)
  @return unquote("\"")+unquote(str-insert($str, "\\", 1))+unquote("\"")

.icon-ok
  &:before
    content: "\e601" // BROKEN
  &:after
    content: unicode("e601") // WORKS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants