Adjusting the font and size throughout the web application
Each PrimeFaces theme has a specific font family and font size, which can be different from theme to theme. This may have a disadvantage in a multi-theme application because switching from one theme to another would cause a broken layout. Furthermore, default font sizes of themes might be bigger than expected. Hence, it is important to know how to change font properties of the PrimeFaces components globally.
In this recipe, we will learn how to adjust the font family and font size throughout the web application.
How to do it...
A simple way to change fonts globally can be accomplished by using the .ui-widget
style class. An example of smaller font is as follows:
.ui-widget, .ui-widget .ui-widget { font-size: 90% !important; }
This might not be enough in some cases, especially when you mix PrimeFaces and JSF standard components based on native HTML pendants. In this case, more CSS selectors are required to be listed in order to adjust...