Download the PHP package xenbyte/font-awesome-svg-twig-bundle without Composer
On this page you can find all versions of the php package xenbyte/font-awesome-svg-twig-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xenbyte/font-awesome-svg-twig-bundle
More information about xenbyte/font-awesome-svg-twig-bundle
Files in xenbyte/font-awesome-svg-twig-bundle
Package font-awesome-svg-twig-bundle
Short Description Symfony bundle to use FontAwesome svg icons as inline svg.
License MIT
Informations about the package font-awesome-svg-twig-bundle
Font Awesome SVG Twig Bundle for Symfony
This bundle enables the support of FontAwesome SVG icons as inline output within twig templates.
Features
- accessability: adds
aria-hidden="true" role="img"
or a title item witharia-labeledby
as recommended by Font Awesome - supports Font Awesome composer package (contains only free icons) and manually provided icons (including pro icons)
- no Font Awesome's css and javascript files necessarry (just css for icon size in your own stylesheet)
Installation
To install this package, you can just use composer. Open a command console, enter your project directory and execute:
If you don't use Symfony Flex, enable the bundle by adding it to the list of registered bundles
in the config/bundles.php
file of your project:
Set up Font Awesome
Option 1: Using the fortawesome/font-awesome package
The composer package contains only the free icons.
Option 2: Provide the font files manually
Copy the files within node_modules/@fortawesome/fontawesome-pro/svgs
to e. g. assets/fontawesome
.
Configuration
If you need to customize the global bundle configuration, you can create a /config/packages/font_awesome_svg_twig.yaml file with your configuration:
Usage examples
Default style is "solid". {{ fa("home") }}
and {{ fa("home", {style: solid) }}
will produce the same output.
As an alternative for adding the styles in the options, you can also add a short prefix for some styles, e.g.
{{ fa("fat home") }}
for {{ fa("home", {style: thin) }}
.
The following prefixes are supported;:
- fas = solid
- far = regular
- fad = duotone
- fat = thin
- fal = light
- fab = brands
It is recommended to add some default css. All icons gets the class fa-icon
:
Options
resource_folder
: Folder with the font awesome iconssvg_class
: Class which is added to the svg element
Limitation
Stacking items is currently not possible with this extension.
All versions of font-awesome-svg-twig-bundle with dependencies
symfony/framework-bundle Version ^6.2 || ^7.0.3
symfony/twig-bundle Version ^6.2 || ^7.0.3
ext-dom Version *