-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(theme): add system color mode to the theme toggle #4675
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
Open
thetaPC
wants to merge
1
commit into
main
Choose a base branch
from
system-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
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 was deleted.
Oops, something went wrong.
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,24 @@ | ||
| /** | ||
| * Original source: | ||
| * @link https://github.com/facebook/docusaurus/blob/v3.10.2/packages/docusaurus-theme-classic/src/theme/Icon/DarkMode/index.tsx | ||
| * | ||
| * Reason for overriding: | ||
| * - Changed the icon to Ionic's moon mark. The artwork is drawn on a 16x16 | ||
| * grid, so only the `viewBox` differs from upstream; the rendered size still | ||
| * matches the light and system icons. | ||
| * - `currentColor` is kept from upstream so the icon inherits `--navbar-icon-link-c`. | ||
| */ | ||
|
|
||
| import React, {type ReactNode} from 'react'; | ||
| import type {Props} from '@theme/Icon/DarkMode'; | ||
|
|
||
| export default function IconDarkMode(props: Props): ReactNode { | ||
| return ( | ||
| <svg viewBox="0 0 16 16" width={24} height={24} fill="none" {...props}> | ||
| <path | ||
| fill="currentColor" | ||
| d="M4.30769 3.38462C4.30769 2.20692 4.48115 1.015 4.92308 0C1.98346 1.27962 0 4.28154 0 7.69231C0 12.2804 3.71962 16 8.30769 16C11.7185 16 14.7204 14.0165 16 11.0769C14.985 11.5188 13.7931 11.6923 12.6154 11.6923C8.02731 11.6923 4.30769 7.97269 4.30769 3.38462Z" | ||
| /> | ||
| </svg> | ||
| ); | ||
| } |
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,24 @@ | ||
| /** | ||
| * Original source: | ||
| * @link https://github.com/facebook/docusaurus/blob/v3.10.2/packages/docusaurus-theme-classic/src/theme/Icon/LightMode/index.tsx | ||
| * | ||
| * Reason for overriding: | ||
| * - Changed the icon to Ionic's sun mark. The artwork is drawn on a 16x16 | ||
| * grid, so only the `viewBox` differs from upstream; the rendered size still | ||
| * matches the dark and system icons. | ||
| * - `currentColor` is kept from upstream so the icon inherits `--navbar-icon-link-c`. | ||
| */ | ||
|
|
||
| import React, {type ReactNode} from 'react'; | ||
| import type {Props} from '@theme/Icon/LightMode'; | ||
|
|
||
| export default function IconLightMode(props: Props): ReactNode { | ||
| return ( | ||
| <svg viewBox="0 0 16 16" width={24} height={24} fill="none" {...props}> | ||
| <path | ||
| fill="currentColor" | ||
| d="M8 3.2a.77.77 0 0 1-.77-.77V.77a.77.77 0 1 1 1.54 0v1.66A.77.77 0 0 1 8 3.2ZM8 16a.77.77 0 0 1-.77-.77v-1.67a.77.77 0 0 1 1.54 0v1.67A.77.77 0 0 1 8 16ZM11.94 4.83a.77.77 0 0 1-.55-1.3l1.18-1.19a.77.77 0 0 1 1.09 1.09L12.48 4.6a.76.76 0 0 1-.54.22ZM2.88 13.88a.77.77 0 0 1-.54-1.3l1.18-1.19a.77.77 0 1 1 1.09 1.09l-1.18 1.18a.76.76 0 0 1-.55.22ZM15.23 8.77h-1.66a.77.77 0 0 1 0-1.54h1.66a.77.77 0 0 1 0 1.54ZM2.43 8.77H.77a.77.77 0 1 1 0-1.54h1.66a.77.77 0 1 1 0 1.54ZM13.12 13.88a.76.76 0 0 1-.55-.22l-1.18-1.18a.77.77 0 0 1 1.09-1.09l1.18 1.18a.76.76 0 0 1-.54 1.31ZM4.06 4.83a.76.76 0 0 1-.54-.22L2.34 3.43a.77.77 0 0 1 1.09-1.09L4.6 3.52a.77.77 0 0 1-.55 1.31ZM8 11.55a3.55 3.55 0 1 1 0-7.1 3.55 3.55 0 0 1 0 7.1Z" | ||
| /> | ||
| </svg> | ||
| ); | ||
| } |
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.
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.
Is this used still? If the default is set to the system, mine is always dark on load now.