-
Notifications
You must be signed in to change notification settings - Fork 12.2k
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
Icons are randomly janky (scssphp) #18775
Comments
Hi! Thanks for being part of the Font Awesome Community. I think this may be related to #17644 Please check how the unicode entities are encoded in the output css file. If the css contains PUA characters like
having the charset directive in the HTML only may not be enough if this is the same issue, let me know so we can continue on #17644 |
@tagliala That was exactly the issue! I'm not too keen on github issues and didn't realize I was only searching in Open. :P Sorry about that, have a great day, and thanks for the fast response! |
@tagliala if I may ask, do you know why it does that at random? I'm not using the JS, so it should be consistent between page refreshes. I've tried everything at this point and can't get things to work properly. If I use the all.css flat out, every character is a broken rectangle on every page. They do show up as If I compile the scss, include Since we're running NGINX, I even went and added |
Nope :\ @GameCharmer if I got this correctly, even when both charset directive are set, it does not work 100% of times but it does help, correct? |
@tagliala correct. I wonder if this is something specific to chrome. Reports from end users have dropped off significantly since adding the meta tag and css charset line, and I've only had it crop up once since making the change. ¯_(ツ)_/¯ The only question I have left is, should the resulting CSS file |
This. As I mentioned in the other thread, there has been a breaking change in a minor release of dart-sass and ruby-sass The only workaround I can see is:
Having a copy of icon variables is frustrating but we can't figure out a way to preserve backward compatibility |
This should have been fixed a while ago in dart-sass 1.38.0 https://github.com/sass/dart-sass/releases/tag/1.38.0 Please give it a try |
@tagliala I don't use dart sass at this time. It looks like there really isn't a good way to handle things in PHP. :P |
Thanks I should install some dependencies to work with scssphp Could you please send me the compiled output of $fa-new-content: false !default;
@function fa-content($fa-var) {
@if $fa-new-content {
@return unquote("\"") + unquote(str-insert($fa-var, "\\", 1)) + unquote("\"");
}
@return unquote("\"#{ $fa-var }\"");
}
$fa-var-500px: \f26e;
@if $fa-new-content {
$fa-var-500px: "f26e";
}
.icon::before {
content: fa-content($fa-var-500px);
} with both |
Output when false
Output when true
|
@GameCharmer if I provide you some instructions to workaround this issue, are you willing to test if that would fix 100% of the cases? |
@tagliala absolutely |
Hi @GameCharmer , I've tried to provide a step by step fix here: diowa/ruby3-rails6-bootstrap-heroku#540 This is based on Font Awesome Free, so steps for Pro should be a little bit different At the end of the procedure, we should check if variables in the output css have the proper escaped entity NOTE: This change will make harder to update Font Awesome Feel free to ask any question |
@tagliala The CSS generates properly with your fix! This shows up properly in the CSS, and my pages are rendering properly after numerous refreshes. .fa-book::before{content:"\f02d"} Thank you! |
@GameCharmer welcome Please let me know if there are changes and you still randomly get failures |
I'm going to lock here and move the discussion to #17644 |
Reopening because of #17644 (comment) |
@GameCharmer unlocked, please report here scssphp specific issues, I will then move to the other thread if they are relevant |
Interesting enough, this time around, if I avoid scss entirely and just load in $faCss = \file_get_contents($faDir.'css/all.css');
$faCss = str_replace('../webfonts/',$faWeb.'webfonts/',$faCss); That works perfect. Sometimes the simplest option is the best option. |
For others, facing the same issue: The problem with displaying the icons incorrectly when contained in unicode characters is Chrome related and happens only in Chrome and other Chromium based browsers (e.g. Edge or Vivaldi). I could not reproduce it on Firefox or Safari. It is not related to FontAwesome, it is related to all Iconfonts using unicode. (Im my case my own font) It can even be reproduced regularly the following way:
It works only once, if you want to repeat, you need to close the developer tools, reload the page, then reopen the developer tools again and reload again. It seems, that chrome does not check or detect the format of the CSS correctly when the page is reloaded with developer tools open at the first time. For me, the best solution was - as mentioned by others before - to add
at the beginning(!) of the .css file to workaround the Chromium engine bug. |
closed because it is a duplicate of #17644
I can't quite explain this one, but it happens randomly using the self-hosted SCSS implementation of Font Awesome 6 Pro. I can go for a few hours without this weird graphic bug occuring. It's totally random, and I can sit and refresh the same page and watch it crop up once every hundred or so refreshes. I'm using Chrome on Win 10
Here's some examples that indicate what's going on better than I could put into words.
|
|
|
|
|
|
|
|
|
|
The text was updated successfully, but these errors were encountered: