June 26, 2020
FontAwesomeSVG-PHP v1.2: Duetone support
Fontawesome added duotone support back in July 2019. So this is a little overdue, but better late than never! You can now use FontAwesomeSVG-PHP v1.2 to output Fontawesome duotone SVG icons with PHP (no JS required).
Output a duoetone icon in single colour:
echo $FA->get_svg('fad fa-laugh-wink', [
'fill' => '#e64980',
]);
Swap layer opacity by adding the fa-swap-opacity
class:
echo $FA->get_svg('fad fa-laugh-wink', [
'fill' => '#e64980',
'class' => 'fa-swap-opacity',
]);
Single colour with custom opacity:
echo $FA->get_svg('fad fa-laugh-wink', [
'fill' => '#e64980',
'secondary' => [
'opacity' => '0.2',
],
]);
Custom colours and opacity:
echo $FA->get_svg('fad fa-laugh-wink', [
'primary' => [
'fill' => '#e64980',
'opacity' => '0.5',
],
'secondary' => [
'fill' => '#fcc417',
'opacity' => '1',
],
]);
Head to the GitHub repo to learn more.