-
-
Notifications
You must be signed in to change notification settings - Fork 382
[Icons] Add xmlns attribute to svg icons #2661
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
Problem is you now add it for everyone, everywhere, even in the inline rendering, where this is not required (and has no realy meaning). I do believe we should try to implement custom attribute allowing/disallow list |
Is it really an issue? Sure it may be not useful when inlining, but is it breaking the document or the browser? Popular icons "libraries" like HeroIcons or FontAwesome or Google's Icons provides SVG icons with a Let's be pragmatic, always adding this |
which will break many tests for us |
Even if the rendered HTML changes, as long as it doesn't break rendering in the browser, that's totally fine. We understand your tests will break, but we do not really cares here, it's not like we are removing some HTML attributes or whatever more impactful. Also, note that we already did this kind of "breaking changes" on Thanks for your comprehension! |
Sorry,but this will expand html size for no reason for us ... Im not against it, but at least config option would be ok |
The HTML size is not a valid reason for me. The attribute’s length is about 44 characters... |
and when you rendering 100 icons in same page it becomes 440 :) |
I'm pretty sure you webserver can compress your HTML response... |
True, but 440 characters represents almost 0,43 ko ! |
i still stand with @smnandre . do as you wish, i will write a script to clean the files |
but the repository size also grows |
Please let's keep the discussion pertinent, I don't think the arguments "my tests will break" nor the "HTML or repo size will grow" are resonable enough to prevent this feature to ship. Otherwise, shouldn't we stop developing things and remove code only? 😬 To move forwards @Enz000, you still need to update Icons tests and we will be fine. Maybe add one or two lines in the change log about the "breaking" thing. Thanks everyone! |
As I said I'm not against it, just do not understand why such a rare need is pushed without opt-in for all users |
I'm sure we can all be a bit more chill here (and respectful). I think all points are valid here: UX Icons was made to render SVG icons in Twig. So I do agree this use case does not feel a valid reason to change the HTML generated by everyone else. On the other side, not having this attribute can be a real pain (at least during development) raising a valid DX problem here. And making it hard to use the icons for anything else than inline rendering. So I do agree this use case does represent a valid reason to change something. Ideally, this situation would have require just a tiny bit of goodwill, some people giving a bit of energy or time (like really not much here) to implement something more clever/adapted. I already mentioned on another issue (quesstion from Javier i think) the following idea: we could add a include/exclude system of attributes, globally and/or by set and/or by usage (in file / at render time), as this seems to be very opiniated debates. So to me forcing this attribute for everyone and storing it in cache is not the best idea, clearly. I suppose this would maybe be something to be done in the commands, via an Input Option. But I don't want either to "penalize" someone that took some time to explain its problem, open a PR to try something, etc. Have a good week-end you guys |
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.
LGTM!
If I will set |
I'd like we don't make a custom option per attribute, and use something more generic / once for all if possible. But a temporary hard-coded option would be acceptable here, until someone has time to make clean things. Discussion / implementation ideas here: #2353 |
@smnandre I didn't said about custom option, I am exploring from what's available: |
I like this. If it doesn't work already, we should make it work. |
22cc585
to
2ce9f41
Compare
Thanks @Enz000. |
The xmlns attribute was not present in the downloaded SVG icons.
To follow the W3C standard, I added it inside the svg tag.