-
-
Notifications
You must be signed in to change notification settings - Fork 315
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Icons] Configure icon sets: path, alias & icon attributes #2156
[Icons] Configure icon sets: path, alias & icon attributes #2156
Conversation
20c31f7
to
511114b
Compare
b966538
to
28454b8
Compare
Merged! Thanks a lot Simon |
I tried but I can't get the expected result.
I tried the following code: ux_icons:
icon_sets:
heroicons:20:solid:
icon_attributes:
fill: 'currentColor'
aria-hidden: true
data-slot: 'icon' |
So i'm pretty sure this would not work, but just to signal "heroicons:20:solid" should be enquoted in yaml ;) |
Then i'm pretty sure heroicons:20:solid is not a icon set prefix (at least not an remote one), right ? |
Could this work with subdirectories then? :) |
I think it's because I put |
I did it like this and it works: # config/packages/ux_icons.yaml
ux_icons:
default_icon_attributes: []
icon_sets:
heroicons-20-solid:
path: '%kernel.project_dir%/assets/icons/heroicons/20/solid'
icon_attributes:
fill: 'currentColor'
data-slot: 'icon' <twig:ux:icon name="heroicons-20-solid:cake" class="h-5 w-5 text-gray-400" /> |
Nice! I was not 100% sure it would :)) |
I'm opening now if you guys have feedback, and i will add more tests the next couple days
Note
This PR brings 3 new features: iconset aliases, custom path and attributes. So let's focus on that 😄
Default attributes
Icon set configuration
Local icons: path
Remote icons: alias
Icon set attributes