While looking at the project, I've noticed some quality of life issues with the CSS file or just how themes are implemented.
Consider using CSS at-rule: @media: prefers-color-scheme
media feature.
This feature will automatically adjust theme settings without using any JS and it will always match the end user's selected preference. This will also prevent the Flash of White issue and the no theme issue when first asked for a name. You can learn more about this here: zwbetz.com/fix-the-white-flash-on-page-load
If you insist on using the buttons for theme selection, then it is best practice to not use the class switcher with the ".light". Instead, just only use ".dark" when using dark mode while the light mode remains the default.
in short, if you insist on using buttons for theme:
HTML code |
Theme |
<body class="light_dark"> |
Light |
<body class="light_dark dark"> |
Dark |
<body class="light_dark light"> |
REMOVE |
Also, the project's SCSS file is bloated. The file feels like someone just copied a regular CSS file and just renamed it into a .scss file. There are a lot of scss features not being taken advantage of.