refactor(theme-classic): replace color mode toggle with button; remove switchConfig#6771
refactor(theme-classic): replace color mode toggle with button; remove switchConfig#6771
Conversation
|
✔️ [V2] 🔨 Explore the source changes: 2722084 🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/6219e3933270f90008336b70 😎 Browse the preview: https://deploy-preview-6771--docusaurus-2.netlify.app |
|
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-6771--docusaurus-2.netlify.app/ |
| const [checked, setChecked] = useState(defaultChecked); | ||
| const [focused, setFocused] = useState(false); | ||
| const inputRef = useRef<HTMLInputElement>(null); | ||
| function Toggle({ |
There was a problem hiding this comment.
Review with hide white space
|
Size Change: +268 B (0%) Total Size: 789 kB
ℹ️ View Unchanged
|
This comment was marked as duplicate.
This comment was marked as duplicate.
|
That looks nice Was wondering what's your opinion on having some kind of SVG interpolation morphing one svg to another? https://web.dev/building-a-theme-switch-component/ Also like this one: https://www.joshwcomeau.com/ |
|
Seems cool. Would be a useful extension. Not sure how much that would hinder the user from swapping out icons though. |
|
|
||
| import type {SwizzleConfig} from '@docusaurus/types'; | ||
|
|
||
| /* eslint sort-keys: "error" */ |
Breaking change
Togglecomponent is renamed toColorModeToggle. Please update your swizzled components.colorMode.switchConfigis deprecated. If you want to customize the icons for light and dark mode, swizzleIconLightMode,IconDarkMode, orColorModeToggleinstead.Motivation
Part of #6717
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Before
After