New font awesome icons - latte generator. Replace older https://github.com/kravcik/nette-macro-fontawesome.
latte:
extensions:
- Kravcik\LatteFontAwesomeIcon\Extension
You can also set default values, it is quite simple:
latte:
extensions:
- Kravcik\LatteFontAwesomeIcon\Extension(defaultStyle: far, defaultFixedWidth: false, defaultElement: i)
defaultStyle
- choose FA style (fas|far|fal|fab etc.), default isfal
defaultFixedWidth
- auto addingfa-fw
to icons, defaults istrue
defaultElement
- HTML element to generate icon, default isspan
Parameters can be named or ordered by numeral indexes (see examples)
color
- color for current icon, generatetext-primary
for bootstrap colors, for others gocolor-xxx
size
- size for current icon, for numeric generatefa-2x
, for stringsfa-lg
fw
- fixed widthfa-fw
for current iconelement
- custom HTML element for current iconstyle
- style for current icon (fas|far|fal|fab etc.)class
- custom class add for current HTML element
Examples depends on default values, so we using default setting (fal, fw, span).
{icon star}
-> <span class="fal fa-star fa-fw"></i>
{icon star, primary}
-> <span class="fal fa-star text-primary fa-fw"></span>
{icon star, red}
-> <span class="fal fa-star color-red fa-fw"></span>
{icon star, null, lg}
-> <span class="fal fa-star fa-lg fa-fw"></span>
{icon star, yellow, 2}
-> <span class="fal fa-star color-yellow fa-2x fa-fw"></span>
{icon star, blue, size: 2, style: far}
-> <span class="fal fa-star color-blue fa-2x"></span>
{icon star, class: foo, color: green}
-> <span class="fal fa-star color-green foo"></span>
Package | PHP | Latte | Font Awesome | Bootstrap |
---|---|---|---|---|
v1 | >=8.1 | >=3 | >5 | 5 |