Token layer
Material system tokens define color, type, shape, elevation, motion, and state.
This page shows how common Starlight components look with the MD3 theme applied. The examples keep Starlight’s original component model in place while the theme adds token-driven color, shape, state, and spacing.
中文内容需要稳定的行高、清晰的段落节奏和不过度夸张的标题层级。这个主题的目标是让 wiki 和技术文档保持高信息密度,同时拥有 Material You 的色彩角色、tonal surface 和清晰状态反馈。
Buttons
Inline nav
Token layer
Material system tokens define color, type, shape, elevation, motion, and state.
Bridge layer
Starlight variables consume MD3 roles through a small compatibility bridge.
Docs density
The default density is compact enough for repeated reference reading.
The theme uses CSS variables as the source of truth for visual decisions.
The local Starlight plugin appends the CSS entrypoint through config:setup.
Component overrides stay optional and are only needed when markup must change.
--md-sys-* tokens.--sl-* variables.Inline code should be legible without becoming a bright pill in the paragraph.
import starlight from '@astrojs/starlight';import md3Theme from 'starlight-theme-md3';
export default { integrations: [ starlight({ plugins: [md3Theme()], }), ],};| Surface | MD3 role | Starlight target |
|---|---|---|
| Page shell | surface-container-lowest |
--sl-color-bg |
| Main content | surface |
main > .content-panel |
| Header | surface-container |
--sl-color-bg-nav |
| Sidebar active item | secondary-container |
[aria-current='page'] |
| Code block | surface-container-low |
Markdown pre |
| Aside tip | primary-container |
.starlight-aside--tip |
A docs theme should make structure obvious, keep reading comfortable, and avoid turning every component into a large app card.