Repository navigation
Add a light/dark theme toggle to the documentation site - #247
Open
NopeCharon wants to merge 1 commit into
Open
NopeCharon wants to merge 1 commit into
NopeCharon wants to merge 1 commit into
Conversation
The site only shipped the dark "awsstyle" color scheme, which some readers find hard to focus on (cedar-policy#224). * Move the rules shared by both themes out of awsstyle.scss into _sass/awsstyle/_base.scss. The hard-coded text, heading, navigation and inline-code colors become variables that each color scheme defines; the dark values are unchanged, so the default look of the site is the same. * Add an awsstyle-light color scheme and its stylesheet (assets/css/just-the-docs-awsstyle-light.scss). * Add a "Light mode" / "Dark mode" button to the page header (header_custom.html). The script in head_custom.html swaps the theme stylesheet before the page renders and stores the choice in localStorage. Dark remains the default for visitors who have not chosen. Signed-off-by: NopeCharon <[email protected]>
NopeCharon
force-pushed
the
light-mode-toggle
branch
from
November 11, 2026 16:33
557f252 to
6fda4db
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #224
The site only had the dark
awsstylecolor scheme. This adds a light variant and a button in the page header to switch between them.awsstyle.scssinto_sass/awsstyle/_base.scss. The hard-coded text, heading, navigation and inline-code colors become variables that each scheme defines. The dark values are unchanged, so the default look is the same.awsstyle-lightcolor scheme plus its stylesheet (assets/css/just-the-docs-awsstyle-light.scss).header_custom.html. The script inhead_custom.htmlswaps the theme stylesheet before the page renders and stores the choice inlocalStorage. Dark remains the default for visitors who haven't chosen, and the site still works if storage is unavailable.Checked by building the site with the repo's Dockerfile setup and loading pages in both themes in a browser; the dark theme looks the same as before.