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:

1echo $FA->get_svg('fad fa-laugh-wink', [
2 'fill' => '#e64980',
3]);

Swap layer opacity by adding the fa-swap-opacity class:

1echo $FA->get_svg('fad fa-laugh-wink', [
2 'fill' => '#e64980',
3 'class' => 'fa-swap-opacity',
4]);

Single colour with custom opacity:

1echo $FA->get_svg('fad fa-laugh-wink', [
2 'fill' => '#e64980',
3 'secondary' => [
4 'opacity' => '0.2',
5 ],
6]);

Custom colours and opacity:

1echo $FA->get_svg('fad fa-laugh-wink', [
2 'primary' => [
3 'fill' => '#e64980',
4 'opacity' => '0.5',
5 ],
6 'secondary' => [
7 'fill' => '#fcc417',
8 'opacity' => '1',
9 ],
10]);

Head to the GitHub repo to learn more.


This content originally appeared on Hussein Al Hammad and was authored by Hussein Al Hammad

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:

1echo $FA->get_svg('fad fa-laugh-wink', [
2 'fill' => '#e64980',
3]);

Swap layer opacity by adding the fa-swap-opacity class:

1echo $FA->get_svg('fad fa-laugh-wink', [
2 'fill' => '#e64980',
3 'class' => 'fa-swap-opacity',
4]);

Single colour with custom opacity:

1echo $FA->get_svg('fad fa-laugh-wink', [
2 'fill' => '#e64980',
3 'secondary' => [
4 'opacity' => '0.2',
5 ],
6]);

Custom colours and opacity:

1echo $FA->get_svg('fad fa-laugh-wink', [
2 'primary' => [
3 'fill' => '#e64980',
4 'opacity' => '0.5',
5 ],
6 'secondary' => [
7 'fill' => '#fcc417',
8 'opacity' => '1',
9 ],
10]);

Head to the GitHub repo to learn more.


This content originally appeared on Hussein Al Hammad and was authored by Hussein Al Hammad


Print Share Comment Cite Upload Translate Updates
APA

Hussein Al Hammad | Sciencx (2020-06-26T00:00:00+00:00) FontAwesomeSVG-PHP v1.2: Duetone support. Retrieved from https://www.scien.cx/2020/06/26/fontawesomesvg-php-v1-2-duetone-support-2/

MLA
" » FontAwesomeSVG-PHP v1.2: Duetone support." Hussein Al Hammad | Sciencx - Friday June 26, 2020, https://www.scien.cx/2020/06/26/fontawesomesvg-php-v1-2-duetone-support-2/
HARVARD
Hussein Al Hammad | Sciencx Friday June 26, 2020 » FontAwesomeSVG-PHP v1.2: Duetone support., viewed ,<https://www.scien.cx/2020/06/26/fontawesomesvg-php-v1-2-duetone-support-2/>
VANCOUVER
Hussein Al Hammad | Sciencx - » FontAwesomeSVG-PHP v1.2: Duetone support. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2020/06/26/fontawesomesvg-php-v1-2-duetone-support-2/
CHICAGO
" » FontAwesomeSVG-PHP v1.2: Duetone support." Hussein Al Hammad | Sciencx - Accessed . https://www.scien.cx/2020/06/26/fontawesomesvg-php-v1-2-duetone-support-2/
IEEE
" » FontAwesomeSVG-PHP v1.2: Duetone support." Hussein Al Hammad | Sciencx [Online]. Available: https://www.scien.cx/2020/06/26/fontawesomesvg-php-v1-2-duetone-support-2/. [Accessed: ]
rf:citation
» FontAwesomeSVG-PHP v1.2: Duetone support | Hussein Al Hammad | Sciencx | https://www.scien.cx/2020/06/26/fontawesomesvg-php-v1-2-duetone-support-2/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.