-
-
Notifications
You must be signed in to change notification settings - Fork 364
[Icons] Introduce symfony/ux-icons
#1450
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
Conversation
b2d6720
to
190d8b2
Compare
I've made the following cache changes:
As Ryan pointed out, there's likely a better way to handle the cache. I'll dig into this but now, it shouldn't hold up a merge/initial release. |
I found the problem with Iconify... it removes attributes from the SVG tag, and insert them in a in the innerSVG. Lucide icon (downloaded from website)<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-activity-square"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M17 12h-2l-2 5-2-10-2 5H7"/></svg> Lucide icon (from repo)<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
>
<rect width="18" height="18" x="3" y="3" rx="2" />
<path d="M17 12h-2l-2 5-2-10-2 5H7" />
</svg> Lucide icon (as SVG + CSS)The idea beeing obviously to not repeat those attributes everywhere and set them globally, leading to small simple SVG files (more or less what Github does on this website) Doc: https://lucide.dev/guide/packages/lucide-static .lucide-icon {
width: 24px;
height: 24px;
stroke: currentColor;
fill: none;
stroke-width: 2;
stroke-linecap: round;
stroke-linejoin: round;
} <svg class="lucide-icon">
<rect width="18" height="18" x="3" y="3" rx="2" /><path d="M17 12h-2l-2 5-2-10-2 5H7"/>
</svg> Much cooler, right ? Iconify Icon (downloaded from website)There is where the problem starts. Iconify added a tag where it moved root attributes to. <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M17 12h-2l-2 5l-2-10l-2 5H7"/></g></svg> Much harder then to optimise things. And the result is the same when provided from the API. ProblemsI see there multiple problems
I'm pretty sure there are solutions to all those points, i am NOT suggesting we don't use this amazing service.. but we should address those |
TwigBundle uses a dedicated directory private function addTwigOptions(ArrayNodeDefinition $rootNode): void
{
$rootNode
->fixXmlConfig('path')
->children()
->scalarNode('autoescape_service')->defaultNull()->end()
->scalarNode('autoescape_service_method')->defaultNull()->end()
->scalarNode('base_template_class')->example('Twig\Template')->cannotBeEmpty()->end()
->scalarNode('cache')->defaultValue('%kernel.cache_dir%/twig')->end()
->scalarNode('charset')->defaultValue('%kernel.charset%')->end()
->booleanNode('debug')->defaultValue('%kernel.debug%')->end()
->booleanNode('strict_variables')->defaultValue('%kernel.debug%')->end()
If the doc is right, the system cache does not seem the ideal place to store 3000 icons, especially if we generate one cache file per icon (two with tags?)
|
Yes, I think this is the conclusion Ryan came to as well. I'm going to dig deeper into this. |
f0c41e5
to
3f6694f
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty happy with this :). That being said, it feels feature complete without a way for users to grab icons. Telling them to download them manually, I think, isn't good enough.
670827d
to
5548e4d
Compare
9fabea0
to
9b6f936
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love this so much ❤️
72426e4
to
42b1923
Compare
42b1923
to
fd873c7
Compare
Congrats! And a huge, huge thanks to both you Kevin and Simon - can't wait to use this |
So this is semi-live now, e.g. https://symfony.com/bundles/ux-icons/current/index.html But the all-important link to get the icons codes is still broken: https://ux.symfony.com/icons Any chance at least that link could work? |
This will be live soon :) Until then, you can find the icons on iconify, as we use their search engine / api. |
Hi, https://icon-sets.iconify.design/lucide/activity-square/: <svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M17 12h-2l-2 5l-2-10l-2 5H7"/></g></svg> https://lucide.dev/icons/square-activity: <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-square-activity"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M17 12h-2l-2 5-2-10-2 5H7"/></svg> There is the |
@seb-jean thanks for reporting this ... but it's better that you create a new issue in the repo. This PR was already merged and the discussion is so long, that your comment will probably get lost. Thank you! |
Hello @seb-jean, could you open a new issue ? It's easier afterwards to follow the issues / what's open or not, etc :) Update: what a timing @javiereguiluz 😸 |
Ok 😄 : #1677 |
Documentation
TODO
symfony/dom-crawler
dependency<twig:UX:Icon />
componentux:icons:import
commandFuture Scope/Ideas
IconNotFoundException
lint:icons
command: