Hope you're well? I'm working on a project that has different images depending on the selected mode (light or dark mode).
I'm not using the CSS query below
@media (prefers-color-scheme: dark) {}
I set up a global COLOR variable on my CSS like so
:root {
--light-color: #f2f8ff;
--dark-color: #13141c;
--third-color: #ffffff; /* for white background like the boxes, FAQ and the footer section */
--fourth-color: #525b6d; /* for paragraphs..*/
--fifth-color: #000000; /* for paragraphs with black background*/
}
.dark-theme {
--light-color: #13141c;
--dark-color: #f2f8ff;
--third-color: #09090b;
--fourth-color: #f2f8ff;
--fifth-color: #f2f8ff;
}
Then I used javascript to apply the click event. if the toggle button is clicked, then the root color will change to the .dark-theme.
can anyone help me with a way to change the images on dark mode and have the same styles and position as the main ones?
Thanks in advance!