As many already know, Elementor is very reluctant to stay up-to-date with their CMS. It still uses Font Awesome version 5 and if you don't have a Pro license for Font Awesome, it is very difficult to integrate FA6 as icons.
So to help fellow developers, here is how you can do it!
In Elementor you can import icon sets that are exported by Fontello (as ZIP).
Because Fontello does not support FA6, you have to generate this ZIP file yourself.
We will do this using Node and Gulp.
a. Create a new folder
b. Inside this folder, initiate a new NPM project that uses Gulp by following the installation documentation here.
c. Install the following dependencies:
npm install --save-dev gulp-concat gulp-rename del sass gulp-sass gulp-postcss postcss-url autoprefixer cssnano gulp-zip
Download the full Font Awesome 6 repository as ZIP and extract these files to you project folder:
/scss/*
/webfonts/*
/metadata/icon-families.json
At the end of scss/_variables.scss
, add these variables:
$fa-css-prefix: fa6;
$fa-font-path: "../font";
$fa-font-display: swap; // Optional
For example, for sharp light:
.fasl,
.#{$fa-css-prefix}-light {
--#{$fa-css-prefix}-style: 300; // <-- Add this line with the correct font-weight number
font-weight: 300;
}
at the end of scss/sharp-light.scss
.
Do this for all font/icon styles you need.
Copy the source code from the gulpfile.mjs
below and save this file in your project folder.
Your project folder should now look like this:
metadata/icon-families.json
node_modules/**
scss/*.scss
webfonts/*.(ttf|woff2)
package.json
gulpfile.mjs
gulp
If all goes well, you now have an output
folder containing folders for each Font Awesome icon set and their zipped version.
output/brands.zip
output/brands/config.json
output/brands/css/brands.css
output/brands/font/fa-brands*
output/regular.zip
...etc
Import the ZIP file of each icon set following the steps mentioned here.
Now you can finally enjoy the latest Font Awesome icons inside your Elementor website:
(Although odds are Elementor will find a way to mess up their code and this will not work anymore..🤷♂️)
Hi dear,
many thanks for your code !
I'me now anable to import AF6 into Elementor.
I've modify your code to use directly metatada/icons.json
icon-families.json on Awesome repo do not include Pro icons list.
Sorry for my bad english ;)