font awesome: switch from svg+js to webfonts.

https://fontawesome.com/how-to-use/on-the-web/other-topics/performance

The default version of Font Awesome uses Javascript to replace <i> tags
with dynamically generated SVG elements. This adds a lot of weight to
the Javascript bundle (at least 1MB+), even when using subsetting to
load only the icons we actually use. The web font version is less
featureful than the JS version, but much lighter weight.
This commit is contained in:
evazion
2019-10-22 16:20:53 -05:00
parent abee048de5
commit 5abbab644d
2 changed files with 4 additions and 3 deletions

View File

@@ -25,8 +25,9 @@ require("jquery-ui/themes/base/draggable.css");
require("jquery-ui/themes/base/resizable.css");
require("jquery-ui/themes/base/theme.css");
require("@fortawesome/fontawesome-free/css/all.css");
require("@fortawesome/fontawesome-free/js/all.js");
require("@fortawesome/fontawesome-free/css/fontawesome.css");
require("@fortawesome/fontawesome-free/css/solid.css");
require("@fortawesome/fontawesome-free/css/regular.css");
importAll(require.context('../src/javascripts', true, /\.js(\.erb)?$/));
importAll(require.context('../src/styles', true, /\.s?css(?:\.erb)?$/));

View File

@@ -44,7 +44,7 @@ $base_font_family: Verdana, Helvetica, sans-serif;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
font-family: "Font Awesome 5 Free", "Font Awesome 5 Pro";
font-family: "Font Awesome 5 Free";
font-weight: 900;
content: $content;
}