Sass does not compile special character

Asked

Viewed 42 times

3

I have a ::after in my Sass code with the content "m²", the question is that after compiled the ² becomes error: inserir a descrição da imagem aqui

It is printing in UTF-8 (@charset "UTF-8";), really do not understand the reason for the error.

  • I was having trouble finding the code of the special character, then I found a special character converter online. Follow the link,

1 answer

3


I have an answer that can help you. It does not resolve the build bug, but solves the question of the superscript number in content.

Repair the content:"" of the element ::after can receive characters in unicode, but to solve this you can use the code unicode of the character replacing the "m²" for "m\00B2". So you avoid the special character and use the only one character code.

See how you run the example. And test to see if you pass the SASS compiler (I believe it will work!)

span::after {
    content: "m\00B2" ;
}
<span>num: </span>

Here is a superscript and subscript character table unicode that might interest you: https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts#Superscripts_and_subscripts_block

  • Caaara, it worked. For me it’s enough!! hahaha' I had tried to put the character code, but I think I got it from a wrong table. Thank you! :)

  • 1

    @Thavilang cool that solved, if you want to use the 3 for example the code is \00B3, but you can refer to the link table there have a few more options! Good luck ai [] s

Browser other questions tagged

You are not signed in. Login or sign up in order to post.