Web usage
Primer supplies semantic custom properties, foundation styles, and interaction guidance. Applications own their components, framework, data, and workflows. The catalog’s working examples are references to adapt, not controls to import.
Use the foundations
Section titled “Use the foundations”Serve the generated tokens, authored type styles, and bundled fonts with their relative paths preserved:
<link rel="stylesheet" href="/dist/tokens.css"><link rel="stylesheet" href="/styles/type.css"><link rel="stylesheet" href="/styles/controls.css"><script src="/styles/controls.js"></script>styles/controls.css is the button, field, row, navigation, folio, and reading-column implementation. Copy examples/screens/ and keep those classes. Do not restate their padding, gaps, or colors.
Set data-primer-theme=“system” on the document root and class=“primer” on the application root. Explicit light and dark appearances remain available. Bare package exports remain supported for existing bundler consumers; new consumers can use hosted static files or a delivered foundation copy without depending on Primer’s checkout.
.application-panel { background: var(--primer-color-background-base); color: var(--primer-color-text-base); padding: var(--primer-space-base); border-radius: var(--primer-shell-radius-panel);}Appearance and roles
Section titled “Appearance and roles”Orange is the default accent. Set data-primer-accent to brown, violet, green, amber, or blue on the same scope to choose an alternative. Pair color.accent.fill and color.accent.on-fill; use color.accent.base for text and icons. Red is reserved for critical actions.
The document/card and inner canvas use color.background.. The outer workspace uses color.shell.. Use necessary borders and decorative separators deliberately. Fable-derived foundations records the source choices and contrast adjustments.
Use type rules, desktop foundations, and component guidance for layout and behavior. A component recipe specifies states and interactions; applications implement it. Icon motion includes a copyable activation recipe with application-owned artwork loading.