Lotus
输入关键词搜索文档。

Theme Tokens

Reference the CSS tokens exposed by Lotus and Prosefly components.

Lotus exposes CSS tokens for theme colors, typography, shape, layout, prose, and the Prosefly component bridge. Use these tokens when a project needs deeper styling control than appearance provides.

Color Palettes

Tailwind colors are exposed through @theme static aliases so they are available even when no utility class references them directly.

Token patternPurpose
--lotus-color-slate-50--lotus-color-slate-950Slate neutral palette.
--lotus-color-zinc-50--lotus-color-zinc-950Zinc neutral palette.
--lotus-color-neutral-50--lotus-color-neutral-950Neutral palette.
--lotus-color-stone-50--lotus-color-stone-950Stone neutral palette.
--lotus-color-red-400, --lotus-color-red-600Red accent steps.
--lotus-color-orange-400, --lotus-color-orange-600Orange accent steps.
--lotus-color-amber-400, --lotus-color-amber-600Amber accent steps.
--lotus-color-yellow-400, --lotus-color-yellow-600Yellow accent steps.
--lotus-color-lime-400, --lotus-color-lime-600Lime accent steps.
--lotus-color-green-400, --lotus-color-green-600Green accent steps.
--lotus-color-emerald-400, --lotus-color-emerald-600Emerald accent steps.
--lotus-color-teal-400, --lotus-color-teal-600Teal accent steps.
--lotus-color-cyan-400, --lotus-color-cyan-600Cyan accent steps.
--lotus-color-sky-400, --lotus-color-sky-600Sky accent steps.
--lotus-color-blue-400, --lotus-color-blue-600Blue accent steps.
--lotus-color-indigo-400, --lotus-color-indigo-600Indigo accent steps.
--lotus-color-violet-400, --lotus-color-violet-600Violet accent steps.
--lotus-color-purple-400, --lotus-color-purple-600Purple accent steps.
--lotus-color-fuchsia-400, --lotus-color-fuchsia-600Fuchsia accent steps.
--lotus-color-pink-400, --lotus-color-pink-600Pink accent steps.
--lotus-color-rose-400, --lotus-color-rose-600Rose accent steps.

Gray Scale

appearance.gray maps one neutral palette into the shared --lotus-gray-* scale.

TokenPurpose
--lotus-gray-50--lotus-gray-950Active neutral scale for the current gray setting.

Supported gray settings are slate, zinc, neutral, and stone.

Semantic Colors

These are the main tokens components should use.

TokenPurpose
--lotus-backgroundPage and shell background.
--lotus-surfaceSubtle panels, hover backgrounds, and neutral soft UI.
--lotus-text-strongHeadings, labels, active text, and high-emphasis UI.
--lotus-textBody copy and default foreground.
--lotus-text-mutedSecondary text, inactive navigation, captions, and helper copy.
--lotus-border-mutedDefault component borders.
--lotus-border-subtleLow-emphasis dividers and sticky chrome borders.
--lotus-border-hoverStronger border state for hoverable controls.
--lotus-code-backgroundInline code and plain code block background.
--lotus-code-borderPlain code block border.

Light mode derives text from darker gray steps. Dark mode switches these tokens to lighter gray steps and darker surfaces.

Accent Colors

TokenPurpose
--lotus-accent-lightAccent value used in light mode.
--lotus-accent-darkAccent value used in dark mode.
--lotus-accentActive accent for the current mode.
--lotus-accent-softLow-emphasis active and hover background.
--lotus-accent-contrastText on solid accent backgrounds.

Built-in accents use Tailwind 600 in light mode and 400 in dark mode. Custom hex accents are converted to light and dark OKLCH values.

Radius

TokenPurpose
--lotus-radius-smInline code, small focus targets, and compact controls.
--lotus-radius-mdButtons, nav items, sidebar items, and form-like controls.
--lotus-radius-lgCards, callouts, dropdowns, and larger surfaces.
--lotus-radius-fullBadges, circular buttons, and round markers.

data-radius controls these values. Supported settings are none, small, medium, large, and full.

Typography

TokenPurpose
--lotus-system-sansBuilt-in system sans fallback stack.
--lotus-system-monoBuilt-in system mono fallback stack.
--lotus-font-sansActive sans font stack.
--lotus-font-monoActive mono font stack.
--default-font-familyTailwind default font family bridge.
--default-mono-font-familyTailwind default mono font family bridge.
--default-font-feature-settingsDefault sans feature settings.
--default-mono-font-feature-settingsDefault mono feature settings.

Lotus does not load web fonts by default. Override --lotus-font-sans and --lotus-font-mono after loading project fonts.

:root {
--lotus-font-sans: "Inter", var(--lotus-system-sans);
--lotus-font-mono: "JetBrains Mono", var(--lotus-system-mono);
}

Layout

TokenPurpose
--lotus-header-heightMain header height.
--lotus-subnav-heightDocs subnav height.
--lotus-docs-chrome-heightCombined sticky header and subnav offset.
--lotus-sidebar-widthDesktop sidebar column width.
--lotus-toc-widthDesktop table-of-contents column width.
--lotus-content-widthMain content column max width.

These tokens are used by sticky offsets, responsive grid columns, sidebar scrolling, and table-of-contents positioning.

Prose

.lotus-prose defines extra tokens for Markdown content.

TokenPurpose
--lotus-prose-font-bodyBody font inside prose.
--lotus-prose-font-headingHeading font inside prose.
--lotus-prose-font-monoMono font inside prose.
--lotus-prose-surface-radiusRadius for code blocks, images, and media.
--lotus-prose-sizeBase prose font size.
--lotus-prose-leadingBody line height.
--lotus-prose-flowDefault vertical spacing between prose blocks.
--lotus-prose-heading-leadingHeading line height.
--lotus-prose-borderBlockquote, table, rule, and footnote borders.
--lotus-prose-markerList marker color.
--lotus-prose-row-backgroundReserved row surface color for dense content.

Expressive Code

Lotus maps Expressive Code UI values to theme tokens through the integration config and prose CSS.

Token or valueLotus source
borderRadiusvar(--lotus-radius-lg)
borderColorvar(--lotus-code-border)
codeBackgroundvar(--lotus-code-background)
codeForegroundvar(--lotus-text)
codeFontFamilyvar(--lotus-font-mono)
uiFontFamilyvar(--lotus-font-sans)
focusBordervar(--lotus-accent)
--ec-brdRadvar(--lotus-prose-surface-radius)
--ec-frm-frameBoxShdCssValnone
--ec-frm-inlBtnBgvar(--lotus-surface)
--ec-frm-inlBtnBrdvar(--lotus-border-muted)
--ec-frm-inlBtnFgvar(--lotus-text-muted)

Prosefly Bridge

Shared MDX components from @prosefly/astro-components read --pl-* tokens. Lotus maps those tokens to its semantic layer.

Prosefly tokenLotus mapping
--pl-background--lotus-background
--pl-surface--lotus-surface
--pl-text-strong--lotus-text-strong
--pl-text--lotus-text
--pl-text-muted--lotus-text-muted
--pl-border-muted--lotus-border-muted
--pl-border-subtle--lotus-border-subtle
--pl-border-hover--lotus-border-hover
--pl-accent--lotus-accent
--pl-accent-soft--lotus-accent-soft
--pl-accent-contrast--lotus-accent-contrast
--pl-info--lotus-info
--pl-info-ink--lotus-info-ink
--pl-info-soft--lotus-info-soft
--pl-info-contrast--lotus-info-contrast
--pl-success--lotus-success
--pl-success-ink--lotus-success-ink
--pl-success-soft--lotus-success-soft
--pl-success-contrast--lotus-success-contrast
--pl-warning--lotus-warning
--pl-warning-ink--lotus-warning-ink
--pl-warning-soft--lotus-warning-soft
--pl-warning-contrast--lotus-warning-contrast
--pl-danger--lotus-danger
--pl-danger-ink--lotus-danger-ink
--pl-danger-soft--lotus-danger-soft
--pl-danger-contrast--lotus-danger-contrast
--pl-radius-sm--lotus-radius-sm
--pl-radius-md--lotus-radius-md
--pl-radius-lg--lotus-radius-lg
--pl-radius-full--lotus-radius-full

Component-Local Tokens

Some MDX components define local tokens for their internal layout.

TokenOwnerPurpose
--pl-steps-startStepsCounter start offset.
--pl-steps-bullet-sizeStepsMarker size.
--pl-steps-bullet-marginStepsGap below each marker before the connector line.
--pl-steps-lineStepsConnector line color.
--pl-steps-marker-backgroundStepsMarker background.
--pl-steps-marker-foregroundStepsMarker text color.
--pl-file-tree-borderFileTreeFile tree outer border color.
--pl-file-tree-lineFileTreeNested guide line color.

Component-local tokens are implementation details. Prefer the semantic tokens above unless a component explicitly documents an override.

Overriding Tokens

Override tokens in project CSS when appearance is not enough.

:root {
--lotus-background: oklch(0.99 0.01 260);
--lotus-text: oklch(0.32 0.03 260);
--lotus-surface: oklch(0.96 0.015 260);
--lotus-border-muted: color-mix(in oklab, var(--lotus-text-muted) 24%, transparent);
}

Update related tokens together. Background, surface, text, muted text, borders, and code colors should be treated as a set.

最后更新于 2026年7月18日

贡献者