?
avatar ced1870
ced1870
28 Sep 2020

Steps to reproduce the issue

create a new template using the Web Assets
$wa = $this->getWebAssetManager();
$wa->useStyle('template.test.ltr');

in the joomla.asset.json file 😄
"assets": [
{
"name": "template.test.ltr",
"type": "style",
"uri": "template.css",
"dependencies": [
"fontawesome"
]
},

Expected result

to load the library Fontawesome from the joomla core

Actual result

load the media/vendor/fontawesome-free/css/fontawesome.min.css file, but the @font-face is missing

no FA icon is working in the page, because the font is not declared 😄
@font-face{font-family:Font Awesome\ 5 Free; ... also for the Brand

in Cassopeia, the font-face is included in the template.min.css file, but if we load FA from the core, it shall be loaded correctly also with the font-face. Else we shall declare the font-face each time, for each template/extension and this is not correct

System information (as much as possible)

4.0.0 beta 4

Additional comments

avatar ced1870 ced1870 - open - 28 Sep 2020
avatar joomla-cms-bot joomla-cms-bot - labeled - 28 Sep 2020
avatar N6REJ
N6REJ - comment - 28 Sep 2020

thanks for reporting this.
This is happening because they (fa ) expect you to load the fontset yourself.

  <!-- reference your copy Font Awesome here (from our CDN or by hosting yourself) -->
  <link href="/your-path-to-fontawesome/css/fontawesome.css" rel="stylesheet">
  <link href="/your-path-to-fontawesome/css/brands.css" rel="stylesheet">
  <link href="/your-path-to-fontawesome/css/solid.css" rel="stylesheet">
avatar ReLater
ReLater - comment - 28 Sep 2020

but if we load FA from the core, it shall be loaded correctly also with the font-face. Else we shall declare the font-face each time, for each template/extension and this is not correct

I agree. Joomla has the webfonts packed. Therefore their should be additional CSS that can be used as additional dependencies to decide which fonts to load (or not load) from /media/ folder.

avatar ced1870
ced1870 - comment - 28 Sep 2020

This is happening because they (fa ) expect you to load the fontset yourself.
may be but in joomla asset there is 1 dependency, "fontawesome". It shall call all the needed CSS to make it work. Not only a part of it ...
as per the FA doc, you must copy and load the 3 files to make it work. They don't say to load only one file


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/30793.
avatar particthistle
particthistle - comment - 17 Oct 2020

Having tested #31096 today during Pizza Bugs & Fun, I've suggested whether @N6REJ should look at how to implement this in Cassiopeia, which would then give an example for template developers to use it in Joomla 4.

Or is this just something to document for developers/implementers to be aware of that FontAwesome is now included in Joomla 4 and you can access the files locally from the atum admin template (end solution may see them need to be moved from atum template to a library location and be called from there?)

avatar N6REJ
N6REJ - comment - 17 Oct 2020

@ced1870 how is J! supposed to know which fontset you want? far, fas, fab? or is it supposed to load all 3 and create tons of bloat?
I don't understand WA but I do understand FA and its a 2 part solution.

avatar ced1870
ced1870 - comment - 17 Oct 2020

when you use the Web Assets Manager to load the depency "fontawesome", it is supposed to load it. Else what is the goal of it ?
This is loaded as joomla library, to avoid to load your own files yourself.
May be that there shall be few options like
"dependencies": ["fontawesome-all"]
"dependencies": ["fontawesome-regular"]
"dependencies": ["fontawesome-solid"]
...

this way we could load only the needed one as you suggested

avatar N6REJ
N6REJ - comment - 17 Oct 2020

someone like @Quy will have to address that. I don't understand WA at all.

avatar Quy
Quy - comment - 31 Oct 2020
avatar Fedik
Fedik - comment - 1 Nov 2020

I guess should be used
node_modules/@fortawesome/fontawesome-free/css/all.css
instead of
node_modules/@fortawesome/fontawesome-free/css/fontawesome.css

need to update build stuff,
I will check some time later

avatar N6REJ
N6REJ - comment - 3 Nov 2020

@Fedik how does that tie in with the fact that modules/articles that have icons use fa icons.

avatar Fedik
Fedik - comment - 3 Nov 2020

what do you mean?

avatar N6REJ
N6REJ - comment - 3 Nov 2020

since, for example, com_content & mod_login, use fa icons wouldn't FA be automatically available for the template too?

avatar Fedik
Fedik - comment - 8 Nov 2020

please test #31364

avatar richard67 richard67 - change - 8 Nov 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-11-08 10:28:52
Closed_By richard67
avatar richard67 richard67 - close - 8 Nov 2020
avatar richard67
richard67 - comment - 8 Nov 2020

Closing as having a pull request. Please test #31364 .

Add a Comment

Login with GitHub to post a comment