Skip to content

feat(heo): improve day-night toggle - #4471

Merged
tangly1024 merged 2 commits into
notionnext-org:mainfrom
amansamani:feature/heo-day-night-toggle
Aug 29, 2026
Merged

feat(heo): improve day-night toggle#4471
tangly1024 merged 2 commits into
notionnext-org:mainfrom
amansamani:feature/heo-day-night-toggle

Conversation

@amansamani

Copy link
Copy Markdown
Contributor

Problem

The HEO theme's current dark mode button has a simple icon-based presentation and does not provide a clear toggle-style interaction.

Solution

Improve the HEO theme's day/night mode toggle with a more intuitive sliding toggle UI.

  • Reuse the existing useGlobal().toggleDarkMode() logic.
  • Keep the existing theme state and persistence mechanism.
  • Replace the previous icon-only presentation with a sliding day/night toggle.
  • Use a semantic <button> for better accessibility.
  • Add aria-label and aria-pressed attributes.
  • Add visible keyboard focus styling.
  • Respect users who prefer reduced motion.
  • Preserve the existing cRef / handleChangeDarkMode interface used by the mobile drawer.

Benefits

  • Provides a clearer and more intuitive light/dark mode control.
  • Gives immediate visual feedback for the current theme.
  • Improves keyboard and screen-reader accessibility.
  • Provides a smoother visual transition between light and dark modes.
  • Reuses the existing global theme-switching mechanism instead of rewriting it.
  • Keeps the change scoped to the HEO theme.

Changes

themes/heo/components/DarkModeButton.js

  • Removed the duplicated dark mode state and persistence logic.
  • Reused the existing toggleDarkMode() function from useGlobal().
  • Replaced the previous Moon/Sun icon presentation with a sliding toggle.
  • Added semantic button behavior.
  • Added aria-label and aria-pressed accessibility attributes.
  • Added visible keyboard focus styling.
  • Added reduced-motion support.
  • Preserved the existing imperative ref API used by the mobile drawer.

Testing

  • Local development environment tested
  • Production build tested
Screenshot 2026-08-27 183201 Screenshot 2026-08-27 183214 Screenshot 2026-08-27 183233 Screenshot 2026-08-27 183240
  • Light → Dark mode
  • Dark → Light mode
  • Theme persistence after refresh
  • Keyboard interaction
  • Mobile drawer interaction
  • yarn lint
  • git diff --check

Documentation

  • Not applicable — no new configuration, environment variable, deployment step, or theme setting was introduced.

Closes #2236

@vercel

vercel Bot commented Aug 27, 2026

Copy link
Copy Markdown

@amansamani is attempting to deploy a commit to the tangly1024's projects Team on Vercel.

A member of the Team first needs to authorize it.

@netlify

netlify Bot commented Aug 27, 2026

Copy link
Copy Markdown

Deploy Preview for notionnext-netlify ready!

Name Link
🔨 Latest commit 5453df6
🔍 Latest deploy log https://app.netlify.com/projects/notionnext-netlify/deploys/6a926f13c4131c000891b711
😎 Deploy Preview https://deploy-preview-4471--notionnext-netlify.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@tangly1024 tangly1024 added enhancement New feature or request theme labels Aug 29, 2026
@tangly1024
tangly1024 merged commit fe7412d into notionnext-org:main Aug 29, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request theme

Projects

None yet

Development

Successfully merging this pull request may close these issues.

【主题切换按钮功能改进】建议加入新样式的白天黑夜切换按钮

2 participants