-
Notifications
You must be signed in to change notification settings - Fork 424
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
widgets\Menu.php $iconClassPrefix should not be static #169
Comments
As asked over here #154 (comment) - would it be better to remove the font-awesome dependency altogether? |
My detailed reply: #154 (comment) Yes, remove the font-awesome dependency, use the CDN. I want to address first, that the use of The v4 FontAwesome is an extremely popular library. If you used the CDN (even the new v5 one), odds are the user already has it in their cache anyways. So it would be better for everyone to use the CDN. I don't understand why people still use it as a dependancy. Things like jQuery, Bootstrap, FontAwesome, all should be using the official CDN links. If you need to modify them, overwrite them with a custom stylesheet loaded after it. Your fix would be 2 staged. First, update your repo to use the latest v4 CDN and remove it from composer. This would reduce people creating new issues, so you can move to the v5 and not look back. I would add the new classes so it supports v5 (fab, fal, far, fas as I mentioned) somewhat in the meantime, for those of us who want v5 before you get it rolled out. So we only have to load the v5 stylesheet and update the html icons. Second, create a new major build version for v5 (no longer supporting v4) and update the code accordingly. The new version has new classes for the same icons. Nowhere in the CSS should you specifically target the font-family (or the unicode content) as there are a few of them now for the free/pro versions, brands, etc. I would even drop targeting the If they have the pro version, they change the URL for the stylesheet in the head section so they can use their pro icons. All icons should be used within the HTML (ie: This makes it so there are only 2 things a person would need to do if they needed a different FA version (version number, or pro). Update their template to the stylesheet in the header and modify the html to reflect the icon. No more composer, rebuilding (if combining/minifying), etc. Simple. |
PRs welcome :) ... but not via CDN, please - we won't use CDN by default due to security issues. |
FAv5 please :)) |
We've removed the FontAwesome dependency in 3.0.0-alpha1 (just create a release) so you can pick your own Font Icon assets. |
Issue:
This doesn't work with the latest FontAwesome v5 icons because a lot of the icons don't start with
fa fa-xxx
. Some start withfab
orfas
.Here are a few examples:
File:
widgets\Menu.php
Line:
31
Currently is:
public static $iconClassPrefix = 'fa fa-';
Should be:
public $iconClassPrefix = 'fa fa-';
Then the corresponding fix on line 84 to this:
: '<i class="' . $this->iconClassPrefix . $item['icon'] . '"></i> ',
Reason:
I am using the latest FontAwesome icons from https://fontawesome.com/icons?d=gallery&m=free loaded via their CDN. So I am not using your built in, out-dated version of FontAwesome.
Implementing this simple fix, would allow us to continue using your plugin along with the latest FontAwesome.
Yes, we would have to set the
$iconClassPrefix
to''
, an empty string, and manually pass the prefixes ourself. Like so:This would only take a couple minutes to update, until you get the rest of this package updated.
The text was updated successfully, but these errors were encountered: