ExtJs 7.6.0 comes with the free version of font-awesome (fa) 5. Has anyone been successful in integrating fa pro 5 with ExtJs 7.6.0 (classic)?
If yes, any tips or instructions?
I found these instructions from here but they apply to integrating fa 5 into ExtJs 6.6.0 which uses fa 4.7 by default.
TIA
I have successfully integrated both
Font Awesome Pro 5 and 6, intoExt JS versions 6 and 7 (classic). I used several guides, including the ones you linked, and last time I even got an upgrade instructions document from Sencha Support.I can tell you, this is not an easy ride since both Ext JS and Font Awesome are changing constantly, every guide is somehow outdated, and even the document I got from Sencha Support was not complete. Many manual tweaks are needed to get it work.
So I can share the steps I followed last time (
Font Awesome Pro 6 - Ext JS 7.6) but chances are good that you will need additional steps to get it work. All paths are relative to your project's root folder.ext/packages/font-awesome).ext/packages/font-awesome/resources.webfontsdirectory under the folder in the previous step, copy files toext/packages/font-awesome/resources/fonts.scssfolder. You have to copy these files underext/packages/font-awesome/sass/etc, but depending on the version, you might need to rename some files. For example in latest FA Pro it isregular.scssetc., but inext/packages/font-awesome/sass/etcyou need to havefa-regular.scss.The following steps should be perfomed in
ext/packages/font-awesome/sass/etc. Honestly I don't know if all of them are necessary, you can try without these or after every step to see how it works out.You always have to execute
sencha app build developmentto test it and repeat it after every change._core.scsschangefont-family: var(--#{$fa-css-prefix}-style-family, '#{$fa-style-family}');tofont-family: var(--#{$fa-css-prefix}-style-family, "#{$fa-style-family}");._duotone-icons.scssand add this:_functions.scss,_icons.scss,_mixins.scssand_shims.scssthere are lines like this:@return unquote("\"#{ $fa-var }\"");. In my current code all of these are transformed like:@return unquote('"\#{ $fa-var }"');. (The part$fa-varvaries, especially in_shims.scss).fa-dividefunction in_functions.scss. The code here caused a stack overflow error. I actually filed a bug report to Font Awesome but I don't know whether it's fixed or not. I ended up with getting rid of thefa-dividefunction. This includes the following steps:_variables.scsschange every call tofa-divideto fixed values, like:fa-divide(20em, 16)to1.25em$fa-li-width * fa-divide(5, 4)to2em@import 'functions';from allscssfiles._variables.scss(this is also because of the previous step, since it is originally in the_functions.scssfile I decided to remove):_variables.scss, outside the closing);:@importlines in thescssfiles, you might need to add a leading underscore, like@import '_variables';instead of@import 'variables';.scssfiles you'd like to use (fa-solid.scssetc.), and make the following adjustments:content: unquote("\"#{ $icon }\"");withcontent: unquote('"\#{ $icon }"');font-familyfor the appropriate one, for example infa-light.scssfromFont Awesome 6 ProtoFont Awesome 6 Pro Light, infa-solid.scssfromFont Awesome 6 ProtoFont Awesome 6 Pro Solidetc.When this is ready, execute
sencha app build developmentto try it out.You should be able to use icon variations in Ext JS code like:
Please let me know how did it work out for you.