Skip to content

feat: add dark mode CSS variables for consistent theme styling (Fixes #1025)#1137

Closed
zeroknowledge0x wants to merge 1 commit into
sublime247:mainfrom
zeroknowledge0x:fix/dark-mode-consistency-1025
Closed

feat: add dark mode CSS variables for consistent theme styling (Fixes #1025)#1137
zeroknowledge0x wants to merge 1 commit into
sublime247:mainfrom
zeroknowledge0x:fix/dark-mode-consistency-1025

Conversation

@zeroknowledge0x
Copy link
Copy Markdown

Fixes #1025

Summary

Add dark mode CSS variables to ensure all customized styling components render correctly in both light and dark themes.

Changes

  • docs-portal/src/css/custom.css:
    • Add [data-theme='dark'] block with primary color variables (brighter green for dark backgrounds)
    • Add dark mode Redoc copy button styling
    • Add dark mode sidebar, navbar, and footer styling
    • Follow Docusaurus convention using [data-theme='dark'] selector

Why This Works

Docusaurus uses [data-theme='dark'] attribute on the root element when dark mode is active. By defining CSS variables under this selector, all components that use var(--ifm-color-primary) automatically adapt to the current theme.

Color Choices

  • Light mode: #2e8555 (medium green) - already defined
  • Dark mode: #4ecb71 (brighter green) - better contrast on dark backgrounds
  • Follows Docusaurus green theme convention

Testing

  1. Open docs portal
  2. Toggle light/dark mode in navbar
  3. Verify all colors adapt correctly
  4. Check Redoc API reference page in both modes
  5. Verify sidebar links are readable in both modes

…ublime247#1025)

Add [data-theme='dark'] CSS variables to ensure all customized styling
components render correctly in both light and dark modes.

Changes:
- Add dark mode primary color variables (brighter green for dark backgrounds)
- Add dark mode Redoc copy button styling
- Add dark mode sidebar, navbar, and footer styling
- Follow Docusaurus convention using [data-theme='dark'] selector
@sublime247 sublime247 closed this May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[GOOD FIRST ISSUE] Add Light/Dark Mode Styling Consistency in Docusaurus

3 participants