Skip to content

Commit f8b2344

Browse files
committed
minor #1798 [Icons] Use lowercase <twig:ux:icon /> in documentation (smnandre)
This PR was squashed before being merged into the 2.x branch. Discussion ---------- [Icons] Use lowercase <twig:ux:icon /> in documentation As previously discussed with `@kbond`, we should use only one format in documentation / website / etc. (both will work, it really is "just" a communication thing) This PR update the documentation and the README (website is already OK) Commits ------- 1cd8e92 [Icons] Use lowercase <twig:ux:icon /> in documentation
2 parents 138ae48 + 1cd8e92 commit f8b2344

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/Icons/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Renders local and remote [SVG icons](https://ux.symfony.com/icons) in your Twig
77
{{ ux_icon('mdi:check', {class: 'w-4 h-4'}) }}
88
99
{# .. or Twig Component #}
10-
<twig:UX:Icon name="mdi:check" class="w-4 h-4" />
10+
<twig:ux:icon name="mdi:check" class="w-4 h-4" />
1111
1212
{# Render the "check" icon from "mdi" pack with class #}
1313
<svg viewBox="0 0 24 24" fill="currentColor" class="w-4 h-4">

src/Icons/doc/index.rst

+14-14
Original file line numberDiff line numberDiff line change
@@ -155,20 +155,20 @@ HTML Syntax
155155
~~~~~~~~~~~
156156

157157
In addition to the ``ux_icon()`` function explained in the previous sections,
158-
this package also supports an alternative HTML syntax based on the ``<twig:UX:Icon>``
158+
this package also supports an alternative HTML syntax based on the ``<twig:ux:icon>``
159159
tag:
160160

161161
.. code-block:: html
162162

163163
<!-- renders "user-profile.svg" -->
164-
<twig:UX:Icon name="user-profile" class="w-4 h-4" />
164+
<twig:ux:icon name="user-profile" class="w-4 h-4" />
165165
<!-- renders "admin/user-profile.svg" -->
166-
<twig:UX:Icon name="admin:user-profile" class="w-4 h-4" />
166+
<twig:ux:icon name="admin:user-profile" class="w-4 h-4" />
167167
<!-- renders 'user-solid.svg' icon from 'Flowbite' icon set via ux.symfony.com -->
168-
<twig:UX:Icon name="flowbite:user-solid" />
168+
<twig:ux:icon name="flowbite:user-solid" />
169169

170170
<!-- you can also add any HTML attributes -->
171-
<twig:UX:Icon name="user-profile" height="16" width="16" aria-hidden="true" />
171+
<twig:ux:icon name="user-profile" height="16" width="16" aria-hidden="true" />
172172

173173
.. note::
174174

@@ -288,16 +288,16 @@ HTML Syntax
288288

289289
.. code-block:: html+twig
290290

291-
<twig:UX:Icon name="user-profile" />
291+
<twig:ux:icon name="user-profile" />
292292

293293
{# Renders "user-profile.svg" #}
294-
<twig:UX:Icon name="user-profile" class="w-4 h-4" />
294+
<twig:ux:icon name="user-profile" class="w-4 h-4" />
295295

296296
{# Renders "sub-dir/user-profile.svg" (sub-directory) #}
297-
<twig:UX:Icon name="sub-dir:user-profile" class="w-4 h-4" />
297+
<twig:ux:icon name="sub-dir:user-profile" class="w-4 h-4" />
298298

299299
{# Renders "flowbite:user-solid" from ux.symfony.com #}
300-
<twig:UX:Icon name="flowbite:user-solid" />
300+
<twig:ux:icon name="flowbite:user-solid" />
301301

302302
.. note::
303303

@@ -376,7 +376,7 @@ of the following attributes: ``aria-label``, ``aria-labelledby`` or ``title``.
376376

377377
.. code-block:: twig+html
378378

379-
<twig:UX:Icon name="user-profile" aria-hidden="false" />
379+
<twig:ux:icon name="user-profile" aria-hidden="false" />
380380

381381

382382
Performance
@@ -408,7 +408,7 @@ In production, you can pre-warm the cache by running the following command:
408408
$ php bin/console ux:icons:warm-cache
409409
410410
This command looks in all your Twig templates for ``ux_icon()`` calls and
411-
``<twig:UX:Icon>`` tags and caches the icons it finds.
411+
``<twig:ux:icon>`` tags and caches the icons it finds.
412412

413413
.. caution::
414414

@@ -440,18 +440,18 @@ TwigComponent
440440
~~~~~~~~~~~~~
441441

442442
The ``ux_icon()`` function is optimized to be as fast as possible. To deliver the
443-
same level of performance when using the HTML syntax (``<twig:UX:Icon name="..." />``),
443+
same level of performance when using the HTML syntax (``<twig:ux:icon name="..." />``),
444444
the TwigComponent overhead is reduced by calling the IconRenderer immediately and
445445
returning the HTML output.
446446

447447
.. warning::
448448

449-
The <twig:UX:Icon> component does not support embedded content.
449+
The <twig:ux:icon> component does not support embedded content.
450450

451451
.. code-block:: twig+html
452452

453453
{# The 🧸 will be ignore in the HTML output #}
454-
<twig:UX:Icon name="user-profile" class="w-4 h-4">🧸</twig:UX:Icon>
454+
<twig:ux:icon name="user-profile" class="w-4 h-4">🧸</twig:ux:icon>
455455

456456
{# Renders "user-profile.svg" #}
457457
<svg viewBox="0 0 24 24" class="w-4 h-4">

0 commit comments

Comments
 (0)