Skip to content

[Icons]: HTML syntax: Closing the tag with </twig:ux:icon> breaks it #2796

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

Closed
ThomasLandauer opened this issue May 29, 2025 · 2 comments
Closed
Labels
docs Improvements or additions to documentation Icons Status: Reviewed Has been reviewed by a maintainer

Comments

@ThomasLandauer
Copy link
Contributor

When doing (as mentioned at https://symfony.com/bundles/ux-icons/current/index.html#twigcomponent )

<twig:ux:icon name="user-profile" class="w-4 h-4">🧸</twig:ux:icon>

I'm getting:

An exception has been thrown during the rendering of a template ("Unknown component "ux:icon". Did you mean this: "UX:Icon"?")

So it looks like only the self-closing syntax is allowed:

<twig:ux:icon name="user-profile" class="w-4 h-4" />

Versions:
Brandnew Symfony 7.3
symfony/ux-icons 2.25.0
symfony/ux-twig-component 2.25.2
twig/twig 3.21.1

P.S.: So the misleading hint for UX:Icon which you mention at #2307 (comment) is still there.

@ThomasLandauer ThomasLandauer added the Bug Bug Fix label May 29, 2025
@carsonbot carsonbot added Icons Status: Needs Review Needs to be reviewed labels May 29, 2025
@smnandre
Copy link
Member

So it looks like only the self-closing syntax is allowed:

It is, and won't change.

It was working initially "by chance". The current behaviour (since 2.21) has not raised any real world problems. On the other hand, beeing more strict about this helped improve preformance big time.

So this is not something that will change now, or in the near future.

If you have time / want to open a PR to improve this part of the documentation, it would be very welcomed 😄

@smnandre smnandre added docs Improvements or additions to documentation Status: Reviewed Has been reviewed by a maintainer and removed Bug Bug Fix Status: Needs Review Needs to be reviewed labels May 29, 2025
@ThomasLandauer
Copy link
Contributor Author

I added a note at #2789 (comment) to remember it :-)
So I'm closing here as "not planned".

@ThomasLandauer ThomasLandauer closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation Icons Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants