Skip to content

content/docs/core/theme-schema.mdx teaches a schema that does not exist — six independent falsehoods, now including the type: 'theme' kind #5489 retires #5648

Description

@os-sales

Found while executing #5489 (retire the dead ThemeComponentSchema / type: 'theme' component kind). Filed unassigned rather than fixed inside that PR: the page needs a rewrite around the retained theme document, which is an editorial job independent of the removal, and five of the six falsehoods below predate #5489 entirely. Folding it in would have made the removal unreviewable.

content/docs/core/theme-schema.mdx (369 lines) is the reference page for theming. Every code block on it is fenced ```plaintext, so nothing typechecks it and check:doc-snippet-types never reads it. Measured against packages/types/src/theme.ts, packages/types/src/zod/theme.zod.ts and @objectstack/spec/ui:

#The page teachesReality
1import type { ThemeSchema } from '@object-ui/types' (title, prose, 3 snippets)No ThemeSchema is exported from @object-ui/types, and none ever was — the same fabrication objectui#5343 fixed in guide/schema-overview.md by re-spelling it ThemeComponentSchema at every site
2import { ThemeSchema } from '@object-ui/types/zod' in the "Runtime Validation" blockThe zod entry exports ThemeDefinitionSchema, not ThemeSchema
3type: 'theme' + themes[] / activeTheme / allowSwitching / persistPreference / storageKey (2 snippets, 1 property table)Retired by #5489 under the maintainer ruling of 2026-08-21. No renderer ever implemented 'theme'
4Per-theme light: ColorPalette / dark: ColorPaletteThe spec Theme carries a single colors map. objectui#5343 already rejected exactly this falsehood in guide/schema-overview.md; this page kept it
5typography.fontSize / typography.lineHeightRetired in @objectstack/spec 17.0.0-rc.3 (objectstack#5021). A theme declaring them is now REFUSED, not accepted-and-stripped. fontFamily.base is the surviving key; customVars is the door for the rest
6mode: 'system', and radius: as the border-radius keyThe spec ThemeMode enum is light | dark | auto; the key is borderRadius

A reader — or an AI agent authoring metadata, which is the population ADR-0033 designs for — who copies any block on this page gets a refused theme or an unknown-component panel.

What the rewrite should target

The theme system is real and explicitly retained by the same ruling (「objectui 引擎代码与单测保留」): Theme from @objectstack/spec/ui (the authoring document), ThemeEngine (packages/core/src/theme/ThemeEngine.ts, CSS-variable generation) and ThemeProvider / ThemeContext (packages/react/src/context/ThemeContext.tsx, application). The page should document that — the shape that is loaded, validated and applied — instead of a component wrapper that never rendered. The token sections (ColorPalette, Typography, BorderRadius) are worth keeping once re-derived from the spec rather than from this page's copy.

Gate note

scripts/check-doc-component-types.mjs exempts theme / theme-switcher / theme-preview for this file. #5489 re-points the theme reason at the retirement and at this card; the exemption stays live (the literals are still on the page), so CI does not flag it. Deleting those three exemption entries is part of finishing this rewrite. theme-switcher / theme-preview are themselves unimplemented — #5647.

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seat

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions