Issue
- As a developer, I would like to apply Font Awesome in my custom theme via Maven.
Environment
- Liferay DXP 7.1
Resolution
1) Create a theme based on the Simple Theme Maven Blade Sample:
blade create -t theme -v 7.1 -b maven -p com.liferay.docs.theme -c Theme theme
2) Add the font_awesome.scss
based on the Importing Clay CSS into a Theme - Customizing Clay Base section to theme/src/main/webapp/css/font_awesome.scss
.
Check if the theme builds successfully (run command 'mvn verify').
3) Deploy the theme to Liferay DXP 7.1.
In a Basic Web Content, add the following code as an example:
<i class="icon-caret-down"></i> icon-caret-down
Into portal_normal.ftl
, add the following code - also as an example:
<@liferay_ui["icon"] icon="angle-down" />
See attached screenshot for results and source of the proof-of-concept theme.
Please note: When applying Font Awesome v3.2.1 included Clay with CSS rules, use font-family: FontAwesome
.
Additional Information
- How to import Clay CSS into a theme:
Importing Clay CSS into a Theme -
In addition, it is also possible to apply Font Awesome via taglibs:
<liferay-ui:icon />
can also be used for this purpose
Liferay UI Icons