Repository navigation
feat: Implement Dark and Light mode support with topbar toggle and auto-detection - #398
Merged
Merged
Conversation
Owner
|
Can you please send this PR again but also increment the version number for the css link: https://github.com/aaronpk/oauth.net/blob/main/includes/_header.php#L16 |
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.
Overview
This PR implements full Dark & Light Mode support across
oauth.net, enabling users to switch between themes manually while respecting their system OS color scheme by default.What's Changed
1. Theme Variables & Styling (
public/stylesheets/style.css)[data-theme="dark"]and@media (prefers-color-scheme: dark):#0b1120) and container surface (#151f32) palettes.#e2e8f0/#94a3b8) and accessible link/heading accents (#93c5fd/#38bdf8)..rfc-badge), spec status pills, decision tree cards, topic links, and table borders..theme-togglebutton.2. Zero-Flicker Script & Header Switcher (
includes/_header.php)<head>that readslocalStorage.getItem('theme')orwindow.matchMedia('(prefers-color-scheme: dark)')to setdata-themeimmediately before DOM paint (eliminates Flash of Unstyled Content / FOUC)..site-topbar.3. Event Handling & OS Synchronization (
includes/_footer.php)#theme-toggleto cycle between light and dark modes and persist choice inlocalStorage.prefers-color-schemechanges when no manual override is active.4. Documentation (
REDESIGN.md)REDESIGN.mdto move "Dark mode" from "Future Considerations" into "Completed".