-
Notifications
You must be signed in to change notification settings - Fork 23
Add dark mode support #148
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
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
f6e88b9
fixed:about
Abhinandankaushik e104587
Update content/theme/templates/menu.html
Abhinandankaushik 89aaef9
Merge remote-tracking branch 'upstream/main'
Abhinandankaushik ec241e7
Merge branch 'main' of https://github.com/Abhinandankaushik/datafusio…
Abhinandankaushik 1b2cfa6
added spell check action
Abhinandankaushik 5125719
added spell check github-action
Abhinandankaushik e6995c0
fixed blog-typos and added flase-positive in the list
Abhinandankaushik 2b3c715
typo lower-case issue fixed
Abhinandankaushik de5426c
added dark-mode support
Abhinandankaushik 5fac75f
fix blog-typos and added false-positive into the list
Abhinandankaushik fa6c303
typos fix-attempt-1
Abhinandankaushik 092883b
Merge branch 'ci/add-typos-spellcheck' of https://github.com/Abhinand…
Abhinandankaushik e8b8781
addec dark-mode
Abhinandankaushik d7d9801
Merge branch 'main' into feat/dark-mode-support
Abhinandankaushik 1f773c7
removed extra box-style and added simple dark-mode feature
Abhinandankaushik a7c36a1
Merge branch 'feat/dark-mode-support' of https://github.com/Abhinanda…
Abhinandankaushik 8160f80
fixed all dark-mode issues
Abhinandankaushik b9a5be3
finalyze dark-mode properties
Abhinandankaushik 9737883
Merge remote-tracking branch 'upstream/main' into feat/dark-mode-support
Abhinandankaushik 07934c3
feat: refine dark mode toggle UX and simplify theme styles
kevinjqliu c243a6b
Update content/js/dark-mode.js
Abhinandankaushik 9d7630f
Update content/js/dark-mode.js
Abhinandankaushik 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
Some comments aren't visible on the classic Files Changed page.
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,100 @@ | ||
| /* Dark Mode Styles */ | ||
| :root { | ||
| --bg-primary: #ffffff; | ||
| --text-primary: #212529; | ||
| --text-secondary: #6c757d; | ||
| --navbar-bg: #343a40; | ||
| --code-bg: #f8f9fa; | ||
| } | ||
|
|
||
| [data-theme="dark"] { | ||
| --bg-primary: #0d1117; | ||
| --text-primary: #e6edf3; | ||
| --text-secondary: #8b949e; | ||
| --navbar-bg: #0d1117; | ||
| --code-bg: #161b22; | ||
| } | ||
|
|
||
| body { | ||
| background-color: var(--bg-primary) !important; | ||
| color: var(--text-primary) !important; | ||
| } | ||
|
|
||
| [data-theme="dark"] .bg-white { | ||
| background-color: var(--bg-primary) !important; | ||
| color: var(--text-primary) !important; | ||
| } | ||
|
|
||
| [data-theme="dark"] a { | ||
| color: #58a6ff !important; | ||
| } | ||
|
|
||
| [data-theme="dark"] a:hover { | ||
| color: #79c0ff !important; | ||
| } | ||
|
|
||
| [data-theme="dark"] .navbar-dark { | ||
| background-color: var(--navbar-bg) !important; | ||
| } | ||
|
|
||
| [data-theme="dark"] pre { | ||
| background-color: var(--code-bg) !important; | ||
| border-radius: 6px; | ||
| } | ||
|
|
||
| .dark-mode-toggle { | ||
| background: none; | ||
| border: none; | ||
| color: rgba(255, 255, 255, 0.8); | ||
| font-size: 1.2rem; | ||
| cursor: pointer; | ||
| padding: 0; | ||
| margin-left: 1rem; | ||
| line-height: 1; | ||
| display: inline-flex; | ||
| align-items: center; | ||
| transition: color 0.15s ease; | ||
| } | ||
|
|
||
| .dark-mode-toggle:hover { | ||
| color: rgba(255, 255, 255, 1); | ||
| } | ||
|
|
||
| .dark-mode-toggle:focus { | ||
| outline: 2px solid #79c0ff; | ||
| outline-offset: 2px; | ||
| } | ||
|
|
||
| .dark-mode-toggle:focus:not(:focus-visible) { | ||
| outline: none; | ||
| } | ||
|
|
||
| .sun-icon { | ||
| display: none; | ||
| } | ||
|
|
||
| .moon-icon { | ||
| display: inline; | ||
| } | ||
|
|
||
| .sun-icon, | ||
| .moon-icon { | ||
| line-height: 1; | ||
| } | ||
|
|
||
| [data-theme="dark"] .sun-icon { | ||
| display: inline; | ||
| } | ||
|
|
||
| [data-theme="dark"] .moon-icon { | ||
| display: none; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs { | ||
| background: var(--code-bg) !important; | ||
| color: var(--text-primary) !important; | ||
| } | ||
|
|
||
| [data-theme="dark"] .hljs-comment { | ||
| color: var(--text-secondary) !important; | ||
| } |
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,46 @@ | ||
| (function() { | ||
| 'use strict'; | ||
|
|
||
| const root = document.documentElement; | ||
|
|
||
| function getTheme() { | ||
| try { | ||
| return localStorage.getItem('theme') || 'light'; | ||
| } catch { | ||
| return 'light'; | ||
| } | ||
| } | ||
|
|
||
| function setButtonState(theme) { | ||
| const toggleButton = document.getElementById('dark-mode-toggle'); | ||
| if (toggleButton) { | ||
| toggleButton.setAttribute('aria-pressed', theme === 'dark' ? 'true' : 'false'); | ||
| } | ||
| } | ||
|
|
||
| function applyTheme(theme) { | ||
| root.setAttribute('data-theme', theme); | ||
| try { localStorage.setItem('theme', theme); } catch { } | ||
| setButtonState(theme); | ||
| } | ||
|
|
||
| function toggleTheme() { | ||
| applyTheme(getTheme() === 'dark' ? 'light' : 'dark'); | ||
| } | ||
|
|
||
| function setupToggleButton() { | ||
| const toggleButton = document.getElementById('dark-mode-toggle'); | ||
| if (toggleButton) { | ||
| setButtonState(getTheme()); | ||
| toggleButton.addEventListener('click', toggleTheme); | ||
| } | ||
| } | ||
|
|
||
| root.setAttribute('data-theme', getTheme()); | ||
|
|
||
| if (document.readyState === 'loading') { | ||
| document.addEventListener('DOMContentLoaded', setupToggleButton); | ||
| } else { | ||
| setupToggleButton(); | ||
| } | ||
| })(); |
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
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.