cecil / theme-fontawesome
Cecil component theme Font Awesome
Fund package maintenance!
ArnaudLigny
Open Collective
Installs: 263
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Twig
Type:cecil-theme
Requires
- cecil/theme-installer: ^1.4|^2.0
README
The Font Awesome component theme for Cecil provides helpers to use Font Awesome icons.
Installation
composer require cecil/theme-fontawesome
Or download the latest archive and uncompress its content in
themes/fontawesome
.
Usage
Add fontawesome
in the theme
section of the config.yml
:
theme: - fontawesome
Import macro in your template:
{% import 'macros/fontawesome.twig' as fontawesome %}
Then include styles and webfonts in the <head>
of your template:
{{ include('partials/fontawesome.twig') }}
Display the desired icon:
{{ fontawesome.icon('<name>', '<style>', '<size>', '<attributes>') }}
<name>
: name of the icon<style>
: style ("regular", "solid" or "brands", "regular" by default)<size>
: font size (optional)<attributes>
: additional HTML attributes (optional)
Example
{{ fontawesome.icon('github', 'brands', 'xl', {style: 'color: #333'}) ~}}
<i class="fa-github fa-brands fa-xl" style="color: #333">