-
-
Notifications
You must be signed in to change notification settings - Fork 26
Description
As already discussed in #17, we've got a gap in how to handle icons in this bundle:
- Lib Tabler icons? not really (as it should because of the theme)
- Lib FontAwesome icon (which version? How to switch to Tabler? ...)
<svg>?<i>?- Tabler's
'icon' classthat doesn't work at all with FontAwesome
Possible solution
We've been using Symfony Ux icon for the past months and it's been a total game-changer!
It works like a charm and the best part is how easy it is to switch between icon sets (Bootstrap, Tabler, FontAwesome).
And we can send the search page to our clients and let them find what they like on their own.
Furthermore, they can provide us with their SVG icons, which we can incorporate into our Symfony application.
Great feature of today's bundle icons
The best part of tabler_icon today is the shortcut/library of words that are equal to an icon:
tabler:
icons:
issue: fas fa-bugSame concept with UX Icon
# config/packages/ux_icons.yaml
ux_icons:
# ...
aliases:
issue: tabler:bug-filledhttps://symfony.com/bundles/ux-icons/current/index.html#icon-aliases
EDITED: Old way
But we ended to reproduce this same feature with UX Icon.
-
By "importing" (downloading) the icon:
php bin/console ux:icons:import tabler:bug
Downloaded at:
assets/icons/tabler/bug.svg -
Rename it to our "shortcut" and move it to the parent icon folder:
assets/icons/issue.svg -
We can now call it like this:
{{ ux_icon('issue') }}- Or with twig component:
<twig:ux:icon name="issue" />
TablerBundle pros
With that external bundle, we can get out of a tight spot with "custom" code that isn't related to the Tabler theme
Plus, we get to remove code to maintain!
TablerBundle cons
- Deprecating
tabler_icon😢
WDYT ?