-
Notifications
You must be signed in to change notification settings - Fork 110
Add Dark Mode Support for Documentation Pages #470
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -544,4 +544,296 @@ ul.share li i { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .container .changeicon .nav-item .dropdown-item a { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| top: 0 !important; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /************************************************* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Dark Mode - Documentation Section | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Color Scheme: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Background: #1C1F24 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Sidebar & Header: #22262B | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Primary Text: #EAEAEA | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Secondary Text: #B9BEC5 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Muted Text: #8B9098 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Accent Color: #F97316 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Borders: #323842 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| * Hover/Active: #2A2F36 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| **************************************************/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* Dark mode for documentation container */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .container-fluid.docs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background-color: #1C1F24; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* Dark mode for documentation sidebar */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-sidebar { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background-color: #22262B; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-right-color: #323842; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-bottom-color: #323842; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* Dark mode for sidebar navigation */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-sidebar .nav > li > a { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #B9BEC5; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-sidebar .nav > li > a:hover { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #EAEAEA; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background-color: transparent; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* Dark mode for active sidebar items */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-sidebar .docs-toc-item.active a, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-sidebar .nav > .active:hover > a, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-sidebar .nav > .active > a { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #F97316; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| font-weight: bold; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background-color: #2A2F36; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* Dark mode for sidebar search */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-search .form-control { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background-color: #323842; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-color: #323842; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #EAEAEA; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-search .form-control::placeholder { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #8B9098; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-search .form-control:focus { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background-color: #323842; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| border-color: #F97316; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #EAEAEA; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| box-shadow: 0 0 0 0.2rem rgba(249, 115, 22, 0.25); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-toggle { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #F97316; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background-color: transparent; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /* Dark mode for documentation content */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-content { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background-color: #1C1F24; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color: #EAEAEA; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-article-container { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| background-color: #1C1F24; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+617
to
+625
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| body.dark .docs-content { | |
| background-color: #1C1F24; | |
| color: #EAEAEA; | |
| } | |
| body.dark .docs-article-container { | |
| background-color: #1C1F24; | |
| } | |
| body.dark .docs-content, | |
| body.dark .docs-article-container { | |
| background-color: #1C1F24; | |
| color: #EAEAEA; | |
| } |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All alert types (info, warning, danger, success) use the same orange border color (#F97316), which defeats the purpose of having different alert types. Users expect visual differentiation: typically blue for info, yellow/orange for warning, red for danger, and green for success. Consider using distinct border colors that maintain good contrast with the dark background while still being semantically meaningful.
| border-color: #F97316; | |
| color: #EAEAEA; | |
| } | |
| body.dark .docs-article-container .alert-warning { | |
| background-color: #22262B; | |
| border-color: #F97316; | |
| color: #EAEAEA; | |
| } | |
| body.dark .docs-article-container .alert-danger { | |
| background-color: #22262B; | |
| border-color: #F97316; | |
| color: #EAEAEA; | |
| } | |
| body.dark .docs-article-container .alert-success { | |
| background-color: #22262B; | |
| border-color: #F97316; | |
| border-color: #3B82F6; /* blue for info */ | |
| color: #EAEAEA; | |
| } | |
| body.dark .docs-article-container .alert-warning { | |
| background-color: #22262B; | |
| border-color: #F97316; /* orange for warning */ | |
| color: #EAEAEA; | |
| } | |
| body.dark .docs-article-container .alert-danger { | |
| background-color: #22262B; | |
| border-color: #EF4444; /* red for danger */ | |
| color: #EAEAEA; | |
| } | |
| body.dark .docs-article-container .alert-success { | |
| background-color: #22262B; | |
| border-color: #22C55E; /* green for success */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The styles for the different alert types (.alert-info, .alert-warning, .alert-danger, .alert-success) are identical. You can group these selectors to reduce code duplication and make the CSS easier to maintain.
body.dark .docs-article-container .alert-info,
body.dark .docs-article-container .alert-warning,
body.dark .docs-article-container .alert-danger,
body.dark .docs-article-container .alert-success {
background-color: #22262B;
border-color: #F97316;
color: #EAEAEA;
}
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .container-fluid selector is styled twice: once on line 832-834 for general use, and again on line 837-839 specifically for .container-fluid.docs .row. The first rule (.container-fluid) will apply to all container-fluid elements including those outside documentation pages. Consider making the first rule more specific (e.g., body.dark .container-fluid.docs) to avoid unintentionally styling non-documentation containers in dark mode.
| body.dark .container-fluid { | |
| body.dark .container-fluid.docs { |
Copilot
AI
Feb 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR claims to add dark mode support, but the website already has a dark mode system via theme configuration (see themes/academic/data/themes/dark.toml with light = false). This PR only adds CSS styling for documentation pages when dark mode is active. It does not implement any new theme switching mechanism or prefers-color-scheme support as claimed in the description. The existing dark mode is controlled via the color_theme parameter in site configuration, not through a toggle or system preference detection.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,7 +36,9 @@ defaultContentLanguage = "en" | |
| hasCJKLanguage = true # Set `true` for Chinese/Japanese/Korean languages. | ||
| defaultContentLanguageInSubdir = true | ||
|
|
||
| paginate = 10 # Number of items per page in paginated lists. | ||
| [pagination] | ||
| pagerSize = 10 | ||
|
Comment on lines
+39
to
+40
|
||
|
|
||
| enableEmoji = false | ||
| footnotereturnlinkcontents = "<sup>^</sup>" | ||
| ignoreFiles = ["\\.Rmd$", "\\.Rmarkdown$", "_files$", "_cache$"] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To improve the maintainability and consistency of the dark mode theme, I recommend defining your color palette using CSS Custom Properties (variables). You've already listed the color scheme in this comment block; defining them as variables within
body.darkwill make it much easier to manage and update colors across the entire stylesheet.For example, you can then use
background-color: var(--doc-bg);instead of hardcoding#1C1F24everywhere.