We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to be able to toggle between light and dark theme.
design a nice light theme then edit https://github.com/Roma-JS/roma-js-on-astro/blob/main/src/styles/main.scss#L144
add to the navbar a toggle button that on click switches between light and dark theme:
document.documentElement.classList.toggle(...)
You need to check in a render blocking script that the default theme matches what the user has selected.
src/styles/main.scss
/* src/styles/main.scss */ :root.rmjs-my-cool-new-theme, .rmjs-yellow-white-theme { color-scheme: light; /* or dark */ --bg-primary: var(--brand-secondary); --bg-secondary: var(--color-light-100); --bg-tertiary: var(--color-dark-200); --text-primary: var(--color-dark-100); --text-secondary: var(--color-dark-100); --accent-primary: var(--brand-secondary); }
<html lang="it" class="rmjs-my-cool-new-theme"> <!-- awesome website here --> </html>
We could use a drop-down menu of we want to support more than 2 themes... but it does not seem that useful atm.
nice to have
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the problem
I want to be able to toggle between light and dark theme.
Describe the proposed solution
1. Add white theme
design a nice light theme then edit https://github.com/Roma-JS/roma-js-on-astro/blob/main/src/styles/main.scss#L144
2. Create theme switcher
add to the navbar a toggle button that on click switches between light and dark theme:
You need to check in a render blocking script that the default theme matches what the user has selected.
How to create a romajs theme
src/styles/main.scss
Alternatives considered
We could use a drop-down menu of we want to support more than 2 themes... but it does not seem that useful atm.
Importance
nice to have
The text was updated successfully, but these errors were encountered: