Skip to content

Keep OpenStation theme tokens out of the form previews - #46

Merged
AllTerrainDeveloper merged 1 commit into
mainfrom
fix/preview-shell-token-bleed
Aug 24, 2026
Merged

AllTerrainDeveloper merged 1 commit into
mainfrom
fix/preview-shell-token-bleed

Conversation

@AllTerrainDeveloper

Copy link
Copy Markdown
Owner

The bug

Previewing a form inside OpenStation let the desktop theme bleed into the preview: with a light form theme (e.g. Clean) under the dark official OpenStation theme, selects, inputs and textareas rendered near-black with white text inside an otherwise white preview card — in the builder canvas, the Theme tab and the Theme Studio.

Why

OpenStation's window-chrome.css themes raw controls in native window bodies:

.os-window__body :is( input[type="text"], …, select, textarea ) {
	background-color: var( --os-ui-surface, #fff );
	color: var( --os-ui-fg, #1e1e1e );
	border-color: var( --os-ui-border-strong, #949494 );
}

That weighs (0,2,1) — one specificity point over .atf-form .atf-input at (0,2,0) — so the shell's tokens won over the form theme's. The shell also claims ::placeholder at the same weight.

The fix

A shield block in builder.css, scoped to the preview surfaces (.atfs-preview__frame, .atfb-preview, .atf-block-preview), restating only the properties the shell claims with the form's own tokens at (0,3,0). It mirrors form.css's field-style ladder (outline / filled / underline / none, hover, focus) in the same source order, so the preview's internal cascade stays exactly the front end's. form.css — the public front-end stylesheet — is untouched.

Verified on the 8889 site (dark official OpenStation theme)

  • Clean previews light: white select, dark text, the theme's own #8c8f94 border — canvas, Theme tab, Studio.
  • Midnight previews with its own surface (rgb(29,35,39)), not the shell's (rgb(26,23,33)).
  • The Filled field style keeps its --atf-surface-alt ground and transparent border, so the mirrored ladder preserves the variant cascade.
  • Success-screen preview unaffected and correct.
  • The standalone preview URL was already immune (separate document, pinned color-scheme: light).

🤖 Generated with Claude Code

https://claude.ai/code/session_01DVAaHFURDGeBzeuWHZ2dcP

OpenStation paints raw controls in native window bodies with its own
tokens — `.os-window__body :is( input[type], select, textarea )` at
(0,2,1) — which outranks `.atf-form .atf-input` at (0,2,0). So a light
form theme previewed on a dark desktop theme rendered near-black selects
and inputs inside a white card, in the builder canvas, the Theme tab and
the Theme Studio alike.

A shield in builder.css restates only the properties the shell claims
(background-color, color, border-color, and the placeholder colour) with
the form's own tokens at (0,3,0), mirroring form.css's field-style
ladder in the same source order so the preview's internal cascade stays
exactly the front end's.

Verified on the 8889 site against the dark official OpenStation theme:
Clean previews light, Midnight previews with its own surface, the filled
variant keeps its --atf-surface-alt ground and transparent border.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DVAaHFURDGeBzeuWHZ2dcP
@AllTerrainDeveloper
AllTerrainDeveloper merged commit 9101248 into main Aug 24, 2026
9 of 12 checks passed
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.

1 participant