Fixed Forcing Duotone in admin navigation

digitalpoint

Well-known member
Affected version
2.3
In XenForo 2.3, admin navigation icons are all forced to Duotone, which might not always be desirable. You are effectively taking away the ability to use solid, regular, light, thin and brands if someone wants to. In my particular case, I use the brands Cloudflare icon, but XenForo tries (unsuccessfully) to present a Duotone version instead.

I propose to keep turning icons into Duotone, but only if the icon doesn't have a specific weight class call out already (maybe someone wants to not use Duotone for whatever reason beyond my reason).

In admin:PAGE_CONTAINER, this:
HTML:
<xf:fa icon="fad {$navigation.icon} fa-fw" /> <span>{$navigation.title}</span>

...becomes this:
HTML:
<xf:fa icon="{{ $navigation.icon|substr(0, 3) === 'fa-' ? 'fad ' : '' }}{$navigation.icon} fa-fw" />

...now you are still doing the same thing (transforming into Dutotone... unless a different class was explicitly called out), but not breaking icons that can't be transformed to Duotone.
 
Last edited:
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.0 Release Candidate 3).

Change log:
Better support alternative FA icon weights for admin navigation items
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom