Skip to content

Replace hardcoded white backgrounds with CSS variables #25

Description

@bonheur15

Problem

Several elements in the CSS use hardcoded background: #fff instead of referencing the CSS custom property system.

Location: CSS in internal/web/views/layout.templ

Affected Lines

  • .builder (line 60): background: #fff
  • .builder .out (line 109): implicit white background
  • .results (line 141): background: #fff
  • .config-ref (line 151): background: #fff

Proposed Fix

Define a --surface variable and use it consistently:

:root {
    --surface: #fff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --surface: #161b22;
    }
}

.builder {
    background: var(--surface);
}

.results {
    background: var(--surface);
}

.config-ref {
    background: var(--surface);
}

Why This Matters

When dark mode is added (see related issue), hardcoded #fff backgrounds will need to be updated individually. Using a variable now makes that change trivial and prevents inconsistencies.

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