Page 1 of 1

Override new theme without !important

Posted: 12 Jan 2019, 23:47
by iMikeDeveloper
Hi guys


I'm using the new new-light theme and it's overlapping my styles.

I inspected the page and the new theme is at the end of the body while my style is in the head

I do not want to use! important because of hover, focus, good practice, etc.

Any solution?

Not Working:

Code: Select all

<h:body>
	<f:facet name="last">
		<h:outputStylesheet library="css" name="components.css"></h:outputStylesheet>
      		<h:outputStylesheet library="css" name="layout.css"></h:outputStylesheet>
	</f:facet>
	
	<!-- Hidden content -->
</h:body>

Code: Select all

 <context-param>
  	<param-name>primefaces.THEME</param-name>
  	<param-value>nova-light</param-value>
  </context-param>
  
Versions:
JSF 2.2
PrimeFaces 6.2.13
WildFly 13

Re: Override new theme without !important

Posted: 14 Jan 2019, 11:06
by tandraschko
If your css is loaded after the theme (you can verify this when you analyse the rendered head tag), thats probably because the selector used in the theme is more exact as yours.
Analyse the selectors via developer tools.