Skip to content

Self-hosted: accent needs a colour control and inline validation, not a bare text field #1359

Description

@feruzm

Follow-up to #1358, which made configuration.general.styles.accent reachable but as a plain string input. That was deliberate and is not sufficient.

The gap

Type banana into the accent field and save. The save succeeds, the value is stored, and the site silently keeps the style template's own colour. Nothing tells the owner their input was not a colour, and nothing on the page changes, so the natural reading is that the feature is broken.

array fields already show inline validation (config-editor.tsx renders a per-field error under the control). string fields have no such surface at all, so this is not a matter of adding a message to an existing mechanism.

Why it was deferred

The editor renders string, select, boolean, number and array. There is no colour type, so a picker needs a renderer case of its own. And a bare <input type="color"> cannot express "unset", which is the value every live instance currently holds and the state an owner has to be able to return to. That is the same constraint that gave the font preset its explicit '' "Theme default" option.

What this needs

  1. A color field type with a renderer case: a picker paired with a hex text input, since the two have to stay in sync and the text input is what expresses empty.
  2. Inline validation on string fields generally, so an accepted-but-meaningless value is visible at the point of entry rather than by its absence of effect.
  3. A way to clear back to the template default that is obvious, matching the font preset's "Theme default" entry.

Worth pairing with a live preview: theme-appearance.ts already derives the hover fill, the on-accent text and the corrected readable text purely, so the values can be shown without saving.

Not in scope

The engine itself. theme-appearance.ts already ignores an unparseable accent and falls back, which is why this is a feedback problem rather than a correctness one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions