I am currently working on a project where I aim to incorporate a dark mode toggle feature. To maintain organization and scalability, I have chosen to implement the SASS (.scss) architecture rather than plain CSS.
My plan is to utilize variables within my .scss files for both light mode (such as $white for background and $black for text color) and dark mode (e.g. $black for background and $white for text color). By selectively importing either of these modes in my main.scss file through @import, I hope to achieve the desired dark mode effect.
In essence, I am seeking assistance with creating a JavaScript script that will allow me to dynamically switch between '@import 'dark'' and '@import 'light'' within my main.scss file at the press of a button.
This means that upon toggling to dark mode, the line in my main.scss file referring to the import will change from '@import 'light'' to '@import 'dark'', and vice versa.
If anyone can offer guidance or support on this matter, it would be greatly appreciated as I have been struggling with finding a solution to this challenge for quite some time now.