Skip to content

Add dark mode support via prefers-color-scheme #20

Description

@bonheur15

Problem

The landing page has no dark mode support. The CSS custom property architecture (--ink, --paper, --muted, --line, --accent) makes adding dark mode straightforward, but it hasn't been implemented.

Location: CSS in internal/web/views/layout.templ (lines 16-22 define the variables, lines 31-35 swap some for the Image CDN tab)

Current State

Light theme only. The theme swap at lines 31-35 only overrides --paper and --accent when the Image CDN tab is active — not --ink, --muted, or --line.

Proposed Fix

Add a prefers-color-scheme: dark media query that overrides the CSS custom properties:

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e4e8eb;
        --muted: #8b949e;
        --line: #30363d;
        --paper: #0d1117;
        --accent: #58a6ff;
    }
    
    .builder {
        background: #161b22;
    }
    
    code, pre, .builder .out {
        background: #0d1117;
    }
    
    .badge {
        background: #1f2937;
        color: #58a6ff;
    }
}

Why This Matters

Dark mode reduces eye strain in low-light environments and is an expected feature for developer tools. The existing CSS variable architecture means this can be added with minimal changes — just the media query block above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions