Skip to content

Add Dark Mode Support to NuttX Website #148

@siddhitripathi25

Description

@siddhitripathi25

Current Behavior:

The NuttX website currently only supports a light theme, which can cause eye strain for users who prefer dark mode, especially during nighttime browsing sessions.

Expected Behavior:

1.Implement a dark mode theme that users can toggle
2.Respect system-level dark mode preferences (prefers-color-scheme)
3.Persist user's theme choice across sessions
4.Ensure all components (code blocks, tables, navigation) are properly styled in both themes

Proposed Solution:

-Add CSS custom properties (variables) for theming
-Implement a theme toggle switch in the header
-Use localStorage to remember user preference
-Support system preference detection
-Create comprehensive dark theme styles for all website elements

Technical Approach:

1.Modify assets/css/main.scss to use CSS variables
2.Add theme toggle in _includes/header.html
3.Implement minimal JavaScript for theme switching
4.Ensure accessibility and proper contrast ratios

Benefits:

1.Improved user experience and accessibility
2.Reduced eye strain for developers
3.Modern web standards compliance
4.Better battery life on OLED devices

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions