We use Font Awesome 6 (Free for Web version).
Icons are copied from the svgs/
archive folder to assets/icons/
.
Comments from the file are removed to reduce the size of the final file (the FontAwesome license is still visible in the LICENSE.txt file).
Icons can be displayed in templates via the Twig function icon()
(see IconExtension
):
{{ icon('status') }}
The parameter is the name of the icon, which corresponds to the name of the icon file without the extension.
You can pass additional classes with the second parameter:
{{ icon('angle-down', 'icon--rotate90') }}
They are then built in a single file (public/icons.svg
) with the following command:
$ make icons