-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add dark mode toggle #3794
New issue
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
Merged
+582
−18
Merged
Add dark mode toggle #3794
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c9edf47
Add dark mode toggle to documentation
tishajain25 2bfb53e
Update GitHub corner styling for dark mode compatibility
tishajain25 46a7574
Address code review feedback
tishajain25 2a40c5f
Address maintainer feedback
tishajain25 7e51ff3
Implement UziTech's suggested button text cycle
tishajain25 c546ce5
Fix cycleTheme to match button cycle: auto → dark → light
tishajain25 20d785c
Fix ESLint errors: remove unused variables
tishajain25 b868a9f
Fix auto mode icon and add dark mode to demo page
tishajain25 81966e0
Fix demo page styling issues
tishajain25 cb2a00c
Fix dark mode issues: GitHub corner banner colors and preview iframe …
tishajain25 4c5d23d
Ensure demo preview iframe follows theme
tishajain25 8234d94
Address code review feedback: fix SVG icon and optimize JS
tishajain25 d8965af
Fix eslint errors: remove unused catch parameter
tishajain25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| /*! | ||
| Theme: GitHub Dark | ||
| Description: Dark theme for syntax highlighting | ||
| Based on GitHub's dark theme colors | ||
| */ | ||
|
|
||
| /* Dark theme syntax highlighting - Manual dark mode */ | ||
| [data-theme="dark"] .hljs { | ||
| color: #e6edf3; | ||
| background: #262c36; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-doctag, | ||
| [data-theme="dark"] .hljs-keyword, | ||
| [data-theme="dark"] .hljs-meta .hljs-keyword, | ||
| [data-theme="dark"] .hljs-template-tag, | ||
| [data-theme="dark"] .hljs-template-variable, | ||
| [data-theme="dark"] .hljs-type, | ||
| [data-theme="dark"] .hljs-variable.language_ { | ||
| color: #ff7b72; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-title, | ||
| [data-theme="dark"] .hljs-title.class_, | ||
| [data-theme="dark"] .hljs-title.class_.inherited__, | ||
| [data-theme="dark"] .hljs-title.function_ { | ||
| color: #d2a8ff; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-attr, | ||
| [data-theme="dark"] .hljs-attribute, | ||
| [data-theme="dark"] .hljs-literal, | ||
| [data-theme="dark"] .hljs-meta, | ||
| [data-theme="dark"] .hljs-number, | ||
| [data-theme="dark"] .hljs-operator, | ||
| [data-theme="dark"] .hljs-variable, | ||
| [data-theme="dark"] .hljs-selector-attr, | ||
| [data-theme="dark"] .hljs-selector-class, | ||
| [data-theme="dark"] .hljs-selector-id { | ||
| color: #79c0ff; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-regexp, | ||
| [data-theme="dark"] .hljs-string { | ||
| color: #a5d6ff; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-built_in, | ||
| [data-theme="dark"] .hljs-symbol { | ||
| color: #ffa657; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-comment, | ||
| [data-theme="dark"] .hljs-code, | ||
| [data-theme="dark"] .hljs-formula { | ||
| color: #8b949e; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-name, | ||
| [data-theme="dark"] .hljs-quote, | ||
| [data-theme="dark"] .hljs-selector-tag, | ||
| [data-theme="dark"] .hljs-selector-pseudo { | ||
| color: #7ee787; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-subst { | ||
| color: #e6edf3; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-section { | ||
| color: #1f6feb; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-bullet { | ||
| color: #f2cc60; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-emphasis { | ||
| color: #e6edf3; | ||
| font-style: italic; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-strong { | ||
| color: #e6edf3; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-addition { | ||
| color: #aff5b4; | ||
| background-color: #033a16; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-deletion { | ||
| color: #ffdcd7; | ||
| background-color: #67060c; | ||
| } | ||
|
|
||
| /* Dark theme syntax highlighting - System preference auto mode */ | ||
| @media (prefers-color-scheme: dark) { | ||
| :root:not([data-theme="light"]) .hljs { | ||
| color: #e6edf3; | ||
| background: #262c36; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-doctag, | ||
| :root:not([data-theme="light"]) .hljs-keyword, | ||
| :root:not([data-theme="light"]) .hljs-meta .hljs-keyword, | ||
| :root:not([data-theme="light"]) .hljs-template-tag, | ||
| :root:not([data-theme="light"]) .hljs-template-variable, | ||
| :root:not([data-theme="light"]) .hljs-type, | ||
| :root:not([data-theme="light"]) .hljs-variable.language_ { | ||
| color: #ff7b72; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-title, | ||
| :root:not([data-theme="light"]) .hljs-title.class_, | ||
| :root:not([data-theme="light"]) .hljs-title.class_.inherited__, | ||
| :root:not([data-theme="light"]) .hljs-title.function_ { | ||
| color: #d2a8ff; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-attr, | ||
| :root:not([data-theme="light"]) .hljs-attribute, | ||
| :root:not([data-theme="light"]) .hljs-literal, | ||
| :root:not([data-theme="light"]) .hljs-meta, | ||
| :root:not([data-theme="light"]) .hljs-number, | ||
| :root:not([data-theme="light"]) .hljs-operator, | ||
| :root:not([data-theme="light"]) .hljs-variable, | ||
| :root:not([data-theme="light"]) .hljs-selector-attr, | ||
| :root:not([data-theme="light"]) .hljs-selector-class, | ||
| :root:not([data-theme="light"]) .hljs-selector-id { | ||
| color: #79c0ff; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-regexp, | ||
| :root:not([data-theme="light"]) .hljs-string { | ||
| color: #a5d6ff; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-built_in, | ||
| :root:not([data-theme="light"]) .hljs-symbol { | ||
| color: #ffa657; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-comment, | ||
| :root:not([data-theme="light"]) .hljs-code, | ||
| :root:not([data-theme="light"]) .hljs-formula { | ||
| color: #8b949e; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-name, | ||
| :root:not([data-theme="light"]) .hljs-quote, | ||
| :root:not([data-theme="light"]) .hljs-selector-tag, | ||
| :root:not([data-theme="light"]) .hljs-selector-pseudo { | ||
| color: #7ee787; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-subst { | ||
| color: #e6edf3; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-section { | ||
| color: #1f6feb; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-bullet { | ||
| color: #f2cc60; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-emphasis { | ||
| color: #e6edf3; | ||
| font-style: italic; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-strong { | ||
| color: #e6edf3; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-addition { | ||
| color: #aff5b4; | ||
| background-color: #033a16; | ||
| } | ||
|
|
||
| :root:not([data-theme="light"]) .hljs-deletion { | ||
| color: #ffdcd7; | ||
| background-color: #67060c; | ||
| } | ||
| } | ||
UziTech marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.