Search code examples
cssjsfjsf-2richfaces

How to get custom css to load after richfaces?


I have found this thread https://community.jboss.org/thread/202276?tstart=0 where user ramkumarps shows a way to load custom CSS after richfaces loads their css, but I would rather not have it load after the content has been loaded.

Is there any way to have it loaded right after richfaces and still in the head tag?


Solution

  • Regardless of where you use the <h:outputStylesheet> tag, the stylesheet is always rendered in the head. The only difference it makes when you add inside the <h:body> is that it will be added after all Richfaces stylesheets have been loaded. Also as mentioned in the example you do not have to add them at the last. You can just add them after <h:body> opening tag which is sufficient to override Richfaces style.

    You can check this by opening the Developer tools inside your browser and see that it renders in the head.