Light mode added when Dark mode is enabled

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
primeUser99282
Posts: 36
Joined: 14 Nov 2021, 01:48

13 Dec 2021, 18:02

I'm having a problem with toggling Dark Mode in Rain layout.

I've tracked it down to PrimeFaces seemingly adding both css files (light and dark) on the page. But I can't figure out where the first instance is coming from.

Here is what loads in the header. The last 3 lines are from the template.xhtml but the rest I can't figure out where they are coming from (note that the light css theme is added, even though in this case the dark mode was on).

Questions:

1. Where are the top 14 statements coming from, and why is the light theme being printed?
2. Why is Facebook being added? I don't have any facebook scripts in our app

<link type="text/css" rel="stylesheet" href="/javax.faces.resource/theme.css.htm?ln=primefaces-rain-chateau-green-light&amp;v=11.0.0-RC2">
<link type="text/css" rel="stylesheet" href="/javax.faces.resource/primeicons/primeicons.css.htm?ln=primefaces&amp;v=11.0.0-RC2">
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/components.css.htm?ln=primefaces&amp;v=11.0.0-RC2">
<script src="https://connect.facebook.net/signals/co ... p;r=stable" async=""></script>
<script async="" src="//connect.facebook.net/en_US/fbevents.js"></script>
<script async="" src="//www.google-analytics.com/analytics.js"></script>
<script type="text/javascript" src="/javax.faces.resource/jquery/jquery.js.htm?ln=primefaces&amp;v=11.0.0-RC2"></script>
<script type="text/javascript" src="/javax.faces.resource/core.js.htm?ln=primefaces&amp;v=11.0.0-RC2"></script>
<script type="text/javascript" src="/javax.faces.resource/components.js.htm?ln=primefaces&amp;v=11.0.0-RC2"></script>
<script type="text/javascript" src="/javax.faces.resource/jquery/jquery-plugins.js.htm?ln=primefaces&amp;v=11.0.0-RC2"></script>
<script type="text/javascript" src="/javax.faces.resource/touch/touchswipe.js.htm?ln=primefaces&amp;v=11.0.0-RC2"></script>
<script type="text/javascript" src="/javax.faces.resource/filedownload/filedownload.js.htm?ln=primefaces&amp;v=11.0.0-RC2"></script>
<script type="text/javascript" src="/javax.faces.resource/inputmask/inputmask.js.htm?ln=primefaces&amp;v=11.0.0-RC2"></script>
<script type="text/javascript" src="/javax.faces.resource/datepicker/datepicker.js.htm?ln=primefaces&amp;v=11.0.0-RC2"></script>
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/css/primeicons.css.htm?ln=rain-layout">
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/css/primeflex.min.css.htm?ln=rain-layout">
<link rel="stylesheet" type="text/css" href="/javax.faces.resource/css/layout-chateau-green-dark.css.htm?ln=rain-layout">

primeUser99282
Posts: 36
Joined: 14 Nov 2021, 01:48

13 Dec 2021, 18:40

This only happens on first page load. If I refresh, it changes the first theme.css definition to dark mode. Also, why are there two stylesheets defined in the first place? Thanks

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

15 Dec 2021, 10:17

Hi,
1. Where are the top 14 statements coming from, and why is the light theme being printed?
- Could you please check the following stylesheet in your project?

Code: Select all

<h:outputStylesheet name="css/#{guestPreferences.layout}.css" library="rain-layout" />
Also, how do you import dark theme?
2. Why is Facebook being added? I don't have any facebook scripts in our app
- We don't add it. This can be related to your browser's extensions.

Best Regards,

Post Reply

Return to “Rain - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest