-
-
Notifications
You must be signed in to change notification settings - Fork 4k
feat: Add dark mode support and CSS improvements #15753
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
+905
−57
Merged
Changes from 2 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2c63266
feat: Add dark mode support and CSS improvements
White-Devil2839 f48de5b
Merge branch 'master' into master
vkarpov15 49200a1
Fix: Requested changes
White-Devil2839 3f5e6e9
Update docs/api_split.pug
vkarpov15 dc35cfa
Update API CSS link in api_split.pug
vkarpov15 fddbf21
Change logo text color and adjust theme toggle position
vkarpov15 8af7b0b
Remove cache-busting query parameters from CSS links
vkarpov15 72150d3
Adjust theme toggle button position
vkarpov15 17d3adf
Refactor theme toggle functions for improved clarity
vkarpov15 8144b3f
Refactor theme styles for dark and light modes
vkarpov15 5bbe4ad
Refactor dark mode styles for syntax highlighting
vkarpov15 032ac69
Refactor theme toggle logic for body class
vkarpov15 68757db
Update docs/css/github.css
vkarpov15 3398f0c
Update docs/css/mongoose5.css
vkarpov15 e2464af
Update docs/js/theme-toggle.js
vkarpov15 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
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 |
|---|---|---|
| @@ -1,31 +1,45 @@ | ||
| code { | ||
| background-color: #eee; | ||
| padding: 2px 4px; | ||
| background-color: var(--code-bg, #eee); | ||
| padding: 2px 6px; | ||
| font-size: 0.9em; | ||
| color: #800; | ||
| color: var(--link-color, #800); | ||
| border-radius: 4px; | ||
| font-family: Menlo, Monaco, Consolas, "Courier New", monospace; | ||
| transition: background-color 0.3s ease, color 0.3s ease; | ||
| } | ||
|
|
||
| pre code { | ||
| background-color: transparent; | ||
| padding: 0; | ||
| font-size: 1em; | ||
| color: #222; | ||
| color: var(--code-text, #222); | ||
| } | ||
|
|
||
| pre { | ||
| display: block; | ||
| padding: 9.5px; | ||
| margin: 10px 0 10px; | ||
| padding: 12px 16px; | ||
| margin: 16px 0; | ||
| font-size: 13px; | ||
| line-height: 1.42857143; | ||
| color: #333; | ||
| word-break: break-all; | ||
| word-wrap: break-word; | ||
| background-color: #f5f5f5; | ||
| border: 1px solid #ccc; | ||
| border-radius: 4px; | ||
| font-family: Menlo,Monaco,Consolas,"Courier New",monospace; | ||
| line-height: 1.6; | ||
| color: var(--code-text, #333); | ||
| word-break: break-word; | ||
| overflow-wrap: break-word; | ||
| overflow-x: auto; | ||
| background-color: var(--code-bg, #f5f5f5); | ||
| border: 1px solid var(--border-color, #ccc); | ||
| border-radius: 6px; | ||
| font-family: Menlo, Monaco, Consolas, "Courier New", monospace; | ||
| box-shadow: 0 1px 3px var(--shadow, rgba(0, 0, 0, 0.1)); | ||
| transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease; | ||
| } | ||
|
|
||
| /* Improve code block copy functionality */ | ||
vkarpov15 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| pre { | ||
| position: relative; | ||
| } | ||
|
|
||
| pre:hover { | ||
| box-shadow: 0 2px 6px var(--shadow, rgba(0, 0, 0, 0.15)); | ||
| } | ||
|
|
||
| /* | ||
|
|
@@ -38,9 +52,10 @@ github.com style (c) Vasily Polovnyov <[email protected]> | |
| display: block; | ||
| overflow-x: auto; | ||
| padding: 0.5em; | ||
| color: #333; | ||
| background: #f8f8f8; | ||
| color: var(--code-text, #333); | ||
| background: var(--code-bg, #f8f8f8); | ||
| -webkit-text-size-adjust: none; | ||
| transition: background-color 0.3s ease, color 0.3s ease; | ||
| } | ||
|
|
||
| .hljs-comment, | ||
|
|
@@ -152,3 +167,166 @@ github.com style (c) Vasily Polovnyov <[email protected]> | |
| .hljs-chunk { | ||
| color: #aaa; | ||
| } | ||
|
|
||
| /* Dark mode support for syntax highlighting */ | ||
| @media (prefers-color-scheme: dark) { | ||
| code { | ||
| background-color: var(--code-bg, #2d2d2d); | ||
| color: var(--link-color, #4a9eff); | ||
| } | ||
|
|
||
| pre { | ||
| background-color: var(--code-bg, #2d2d2d); | ||
| border-color: var(--border-color, #444); | ||
| color: var(--code-text, #e0e0e0); | ||
| } | ||
|
|
||
| .hljs { | ||
| background: var(--code-bg, #2d2d2d); | ||
| color: var(--code-text, #e0e0e0); | ||
| } | ||
|
|
||
| .hljs-comment, | ||
| .diff .hljs-header, | ||
| .hljs-javadoc { | ||
| color: #6a9955; | ||
| } | ||
|
|
||
| .hljs-keyword, | ||
| .css .rule .hljs-keyword, | ||
| .hljs-winutils, | ||
| .nginx .hljs-title, | ||
| .hljs-subst, | ||
| .hljs-request, | ||
| .hljs-status { | ||
| color: #569cd6; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| .hljs-number, | ||
| .hljs-hexcolor, | ||
| .ruby .hljs-constant { | ||
| color: #b5cea8; | ||
| } | ||
|
|
||
| .hljs-string, | ||
| .hljs-tag .hljs-value, | ||
| .hljs-phpdoc, | ||
| .hljs-dartdoc, | ||
| .tex .hljs-formula { | ||
| color: #ce9178; | ||
| } | ||
|
|
||
| .hljs-title, | ||
| .hljs-id, | ||
| .scss .hljs-preprocessor { | ||
| color: #d7ba7d; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| .hljs-class .hljs-title, | ||
| .hljs-type, | ||
| .vhdl .hljs-literal, | ||
| .tex .hljs-command { | ||
| color: #4ec9b0; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| .hljs-tag, | ||
| .hljs-tag .hljs-title, | ||
| .hljs-rules .hljs-property, | ||
| .django .hljs-tag .hljs-keyword { | ||
| color: #569cd6; | ||
| font-weight: normal; | ||
| } | ||
|
|
||
| .hljs-attribute, | ||
| .hljs-variable, | ||
| .lisp .hljs-body { | ||
| color: #9cdcfe; | ||
| } | ||
|
|
||
| .hljs-regexp { | ||
| color: #d16969; | ||
| } | ||
|
|
||
| .hljs-symbol, | ||
| .ruby .hljs-symbol .hljs-string, | ||
| .lisp .hljs-keyword, | ||
| .clojure .hljs-keyword, | ||
| .scheme .hljs-keyword, | ||
| .tex .hljs-special, | ||
| .hljs-prompt { | ||
| color: #c586c0; | ||
| } | ||
|
|
||
| .hljs-built_in { | ||
| color: #4fc1ff; | ||
| } | ||
|
|
||
| .hljs-preprocessor, | ||
| .hljs-pragma, | ||
| .hljs-pi, | ||
| .hljs-doctype, | ||
| .hljs-shebang, | ||
| .hljs-cdata { | ||
| color: #808080; | ||
| font-weight: bold; | ||
| } | ||
|
|
||
| .hljs-deletion { | ||
| background: #5a1d1d; | ||
| color: #f48771; | ||
| } | ||
|
|
||
| .hljs-addition { | ||
| background: #1e3a1e; | ||
| color: #b5cea8; | ||
| } | ||
|
|
||
| .diff .hljs-change { | ||
| background: #2d4d2d; | ||
| color: #4ec9b0; | ||
| } | ||
|
|
||
| .hljs-chunk { | ||
| color: #808080; | ||
| } | ||
| } | ||
|
|
||
vkarpov15 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| /* Accessibility: Ensure sufficient contrast for code */ | ||
| code, | ||
| pre, | ||
| .hljs { | ||
| /* WCAG AA compliant contrast ratios */ | ||
| min-height: 1.5em; | ||
| } | ||
|
|
||
| /* Improve code block readability on small screens */ | ||
| @media (max-width: 768px) { | ||
| pre { | ||
| font-size: 12px; | ||
| padding: 10px; | ||
| margin: 12px 0; | ||
| } | ||
|
|
||
| code { | ||
| font-size: 0.85em; | ||
| padding: 2px 4px; | ||
| } | ||
| } | ||
|
|
||
| /* Print styles for code blocks */ | ||
| @media print { | ||
| pre { | ||
| border: 1px solid #ccc; | ||
| page-break-inside: avoid; | ||
| background: #f5f5f5; | ||
| color: #000; | ||
| } | ||
|
|
||
| code { | ||
| background: #f0f0f0; | ||
| color: #000; | ||
| } | ||
| } | ||
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.