How to override CSS from PrimeFaces added via Maven?

3

I'm using MegaMenu in my project, but its options are much larger than the width of the columns of this component, so the menu options go beyond the area intended for them, which looks really ugly.

I added primefaces via Maven. How do I change the MegaMenu CSS so that the columns are wider, change colors, etc.?

Or if you do not need to change CSS, how do I?

    
asked by anonymous 11.02.2016 / 23:58

1 answer

3

Just declare the style sheet that contains what you need to override after you load the firstfaces. Since primefaces will be in <head /> , you can declare:

<h:head>
    <!-- normal aqui -->
</h:head>
<h:body>
    <h:outputStylesheet name="sua-folha-de-estilos.css" />
    <!-- segue o corpo da sua página -->
</h:body>

Another way is to use styleClass to set class (s) with custom style, style for CSS and so on.

Depending on you may need to "force" your style to be applied and not the firstfaces, so in the latter case you can use !important , but first see how previous styles.

    
12.02.2016 / 00:28