Use tokens, not hex values
Build with semantic roles.
Load hatsune-miku-theme.css and use its semantic custom properties for surfaces, text, actions, fields, and syntax. It follows the system color scheme by default. Set data-hm-theme to one of light, dark, snow-2024, mm-2025 on <html> or a container to choose or scope a theme.
Match secondary text to its surface: use --hm-color-text-secondary on page or content, --hm-color-text-on-chrome-secondary on chrome, and --hm-color-text-on-overlay-secondary on overlays. Action foreground and background pairs are surface-independent.
Preview in context
Test components and syntax together.
The controls below use state-specific foreground, background, border, focus, and field tokens. Status labels and symbols keep meaning independent of color.
Release settings
Check real interface roles across every registered theme before using one on another site.
Tab through the controls to inspect the shared focus ring.
- Success
- Warning
- Error
- Information
theme.ts
// Semantic roles survive framework changes.
export const theme = await loadTheme({
name: 'Hatsune Miku Theme',
voices: 4,
mode: 'system'
});
function ThemeChip(props: ThemeProps) {
return <button data-hm-theme="dark">
{props.label}
</button>;
}
Resolved token values
Inspect the Web color tokens.
Switch themes to update every swatch and its resolved browser value. Use the --hm-* property in CSS; displayed colors are generated reference output, not values to copy.
01
Foundations
Surfaces, structure, and keyboard focus.
-
Page
--hm-color-surface-pageComputed in your browser -
Content
--hm-color-surface-contentComputed in your browser -
Chrome
--hm-color-surface-chromeComputed in your browser -
Overlay
--hm-color-surface-overlayComputed in your browser -
Default border
--hm-color-border-defaultComputed in your browser -
Subtle border
--hm-color-border-subtleComputed in your browser -
Focus ring
--hm-color-focus-ringComputed in your browser
02
Content
Readable text by surface, plus links, selection, and caret.
-
Primary text
--hm-color-text-primaryComputed in your browser -
Secondary text
--hm-color-text-secondaryComputed in your browser -
Secondary on chrome
--hm-color-text-on-chrome-secondaryComputed in your browser -
Secondary on overlay
--hm-color-text-on-overlay-secondaryComputed in your browser -
Subtle text
--hm-color-text-subtleComputed in your browser -
Placeholder
--hm-color-text-placeholderComputed in your browser -
Default link
--hm-color-link-defaultComputed in your browser -
Active link
--hm-color-link-activeComputed in your browser -
Selection
--hm-color-selection-backgroundComputed in your browser -
Caret
--hm-color-caretComputed in your browser
03
Accents and status
Brand accents and labeled status foregrounds for content surfaces.
-
Primary accent
--hm-color-accent-primaryComputed in your browser -
Secondary accent
--hm-color-accent-secondaryComputed in your browser -
Tertiary accent
--hm-color-accent-tertiaryComputed in your browser -
Success
--hm-color-status-successComputed in your browser -
Warning
--hm-color-status-warningComputed in your browser -
Error
--hm-color-status-errorComputed in your browser -
Information
--hm-color-status-infoComputed in your browser
04
Syntax voices
Representative roles from the complete syntax contract.
-
Keyword
--hm-color-syntax-keywordComputed in your browser -
Control keyword
--hm-color-syntax-keyword-controlComputed in your browser -
Variable
--hm-color-syntax-variableComputed in your browser -
Function
--hm-color-syntax-functionComputed in your browser -
String
--hm-color-syntax-stringComputed in your browser -
Type
--hm-color-syntax-typeComputed in your browser -
Class
--hm-color-syntax-classComputed in your browser -
Number
--hm-color-syntax-numberComputed in your browser -
Operator
--hm-color-syntax-operatorComputed in your browser -
Comment
--hm-color-syntax-commentComputed in your browser -
Tag
--hm-color-syntax-tagComputed in your browser -
Attribute
--hm-color-syntax-attributeComputed in your browser