Skip to content

Commit 11d1a09

Browse files
committed
Feedback
1 parent 82871e1 commit 11d1a09

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/Icons/doc/index.rst

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ a subdirectory, the *name* will be ``subdirectory:icon_name``.
168168
On-Demand Open Source Icons
169169
~~~~~~~~~~~~~~~~~~~~~~~~~~~
170170
Add your SVG icons to the ``assets/icons/`` directory and commit them.
171-
The name of the file is used as the _name_ of the icon (``name.svg`` will be named ``name``).
172-
If located in a subdirectory, the _name_ will be ``sub-dir:name``.
171+
The name of the file is used as the *name* of the icon (``name.svg`` will be named ``name``).
172+
If located in a subdirectory, the *name* will be ``sub-dir:name``.
173173

174174
.. code-block:: text
175175
@@ -243,13 +243,18 @@ the ``assets/icons/`` directory. You can think of importing an icon as *locking
243243
Rendering Icons
244244
---------------
245245

246-
.. code-block:: html+twig
246+
.. code-block:: twig
247247
248-
{{ ux_icon('user-profile', {class: 'w-4 h-4'}) }} <!-- renders "user-profile.svg" -->
248+
{# includes the contents of the 'assets/icons/user-profile.svg' file in the template #}
249+
{{ ux_icon('user-profile') }}
249250
250-
{{ ux_icon('sub-dir:user-profile', {class: 'w-4 h-4'}) }} <!-- renders "sub-dir/user-profile.svg" (sub-directory) -->
251+
{# icons stored in subdirectories must use the 'subdirectory_name:file_name' syntax
252+
(e.g. this includes 'assets/icons/admin/user-profile.svg') #}
253+
{{ ux_icon('admin:user-profile') }}
251254
252-
{{ ux_icon('flowbite:user-solid') }} <!-- renders "flowbite:user-solid" from ux.symfony.com -->
255+
{# this downloads the 'user-solid.svg' icon from the 'Flowbite' icon set via ux.symfony.com
256+
and embeds the downloaded SVG contents in the template #}
257+
{{ ux_icon('flowbite:user-solid') }}
253258
254259
HTML Syntax
255260
~~~~~~~~~~~
@@ -378,7 +383,7 @@ Caching
378383
On-Demand VS Import
379384
^^^^^^^^^^^^^^^^^^^
380385

381-
While *on-demand* icons are great during development, they require http requests to fetch the icon
386+
While *on-demand* icons are great during development, they require HTTP requests to fetch the icon
382387
and always use the *latest version* of the icon. It's possible the icon could change or be removed
383388
in the future. Additionally, the cache warming process will take significantly longer if using
384389
many _on-demand_ icons. You can think of importing the icon as *locking it* (similar to how

0 commit comments

Comments
 (0)