Dark mode in CSS Bootstrap 5.3

Hi,

I am working on a website where I am using, for the 1st time, the dark and light mode. It is working except for one thing: my client wants the dark mode to be the default mode but despite specifying this

<html lang="es" data-bs-theme="dark">

it is coming up as light mode.

I saw a code called APP.colorModes in theme.min.js but I am not sure if I have to do some changes in it
The website can be seen here.

I’ve moved this to the JS Forum as its something in theme.js that is dynamically changing the html element from your manual setting.

2 Likes

Changing

 t = () => e ? e : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light",

To

 t = () => e ? e : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "dark",

Seems to solve the issue

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.