style: add dark mode theme with toggle functionality#662
Conversation
Implement comprehensive dark mode support with automatic system preference detection and manual toggle. Includes CSS variables for theming, JavaScript toggle with localStorage persistence, GitHub markdown CSS overrides, and prevents page navigation color blink. Features: * CSS variables for light/dark theme colors * Theme toggle button with SVG icons in header * System preference detection (prefers-color-scheme: dark) * localStorage persistence for user preference * GitHub markdown CSS dark theme overrides * Netlify badge switching for dark/light modes * Fixed dropdown styling in dark mode * Immediate theme application to prevent color blink Closes conventional-commits#607
|
👋 @damianopetrungaro could you please review and give feedbacks on this PR ? |
|
👋 @lorenzodianni since you initiated the design and the new UI, could you please review this? |
|
Hi @Jorgagu, thanks for the PR! In my opinion, if we move forward with this restyle without upgrading the package, we’ll have significant technical debt in the near future. @damianopetrungaro what do you think? |
|
@lorenzodianni If you’d like, I can upgrade the |
|
@lorenzodianni any updates ? |
This pull request adds full support for light and dark themes to the site, including a user-toggleable theme switcher, persistent theme preference, and dynamic styling across all major components. It introduces new SCSS variables and theme-specific styles, updates markup to support theme switching, and adds the necessary JavaScript logic for toggling and storing the user's theme choice.
Theme support and switching:
ThemeTogglebutton (theme-toggle.html) to the site header and implemented its styling and logic, allowing users to switch between light and dark modes and persist their preference inlocalStorage. [1] [2] [3] [4] [5]theme-darkortheme-light) into the HTML root element on page load, based on user preference or system settings, and loaded the theme toggle script in the main HTML head.SCSS and CSS enhancements:
_theme-variables.scssand imported them into the main stylesheet, enabling consistent color management for both themes. [1] [2]_dark-mode.scssto ensure all components and markdown content are visually coherent in dark mode, including overrides for third-party markdown CSS and icon color switching.Visual improvements for theme-specific assets:
Version bump:
package.jsonandpackage-lock.jsonto version 1.1.0 to reflect the addition of theme support. [1] [2]Closes #607