I found the problem and have a solution to the problem
I'm using the Serenity theme and the problem is the "body .ui_icon" in the theme.css:
Code: Select all
body .ui-icon {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 20px;
display: inline-block;
width: 20px;
height: 20px;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
text-indent: 0;
overflow: visible;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga'; }
I need to override the "font-family: 'Material Icons'" to fix the problem.
Custom CSS:
Code: Select all
.fa-pro-fab {
font-family: 'Font Awesome 5 Brands' !important;
font-weight: 400 !important;
}
.fa-pro-fal {
font-family: 'Font Awesome 5 Pro' !important;
font-weight: 300 !important;
}
.fa-pro-far {
font-family: 'Font Awesome 5 Pro' !important;
font-weight: 400 !important;
}
.fa-pro-fas {
font-family: 'Font Awesome 5 Pro' !important;
font-weight: 900 !important;
}
And now it's working with:
Code: Select all
<p:commandButton type="button" value="Test1" icon="fa-pro-fas fas fa-stroopwafel"/>
<p:commandButton type="button" value="Test2" icon="fa-pro-far far fa-stroopwafel"/>
<p:commandButton type="button" value="Test3" icon="fa-pro-fal fal fa-stroopwafel"/>
<p:commandButton type="button" value="Test4" icon="fa-pro-fab fab fa-font-awesome"/>
PrimeFaces 7.0.8 * Serenity Layout 2.0.1 * WildFly 18.0.0.Final * JEE 8 * OpenJDK 11.0.4