A user wants to build a menu with icons instead of texts.
He enters "icon-eye" as link class (or another class see issue #30793)
and sets displlay menuTitle off
Same behaviour as with images:
If display menuTitle is off, show only the icon with visually hidden Menu Title as Text
The icon is displayed (no aria-hidden = true), the menu Item title also is displayed (but with wrong font) also if "display menu title" is off
Labels |
Added:
?
|
Title |
|
The issue of the wrong font when the icon class is used has been raised before. I believe it is caused because fontawesome is classed as a serif font
Same in J3 - probably never tried this before without override.
If it were possible to use an icon in the same way as an image it can be made a11y and displayed independent of the menu item title.
At this time that would need quite a bit of markup change in the menu module. Because of the way the icon changes the font it needs be a separate class and not a class on the link itself. Which also means it would have to be a separate field so that you could still add a link class
The problem is that the link class adds a class to the entire link when all you want is to add a new span just for the icon. This could be achieved with an override. To change it for core it would require a lot more as you would need to keep the link class and then add another field for an icon class and its associated markup.
Another option without changing markup is you could change the css as below. Replacing Roboto with your own site font
.fa, .fas, [class*=" icon-"], [class^=icon-] {
font-family: Font Awesome\ 5 Free, Roboto;
font-weight: 900;
}
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-07-06 17:44:16 |
Closed_By | ⇒ | chmst |
Has this ever been possible? I know in Joomla 3 I used an image to achieve this