
Description
@primer/primitives contains the colour, spacing and typography values behind Primer, GitHub's design system. It is distributed on npm and provides the values as design tokens. Built files are in the dist folder, and the dist/css directory holds CSS files whose values are available as CSS variables. The README lists all available imports and notes that motion CSS imports are required for components with animations, such as the Spinner in @primer/react. Spacing tokens give a single semantic scale for gap, padding and margin, and the functional/spacing/space.css import provides the --space-* tokens. Token data lives in src/tokens and is compiled with Style Dictionary through scripts/buildTokens.ts. The project adds an overrides system on top of Style Dictionary. There are two main colour modes, light and dark, plus accessibility modes such as light high contrast, which are built by listing only the changes from the main mode. Overrides must be added to themes.config.ts to take effect. The README also links to Storybook and to documentation on theming and CSS variables.…
Highlights
- Colour, spacing and typography tokens
- CSS variables for Primer's design system
- Light, dark and high-contrast modes
- Spacing scale for gap, padding and margin
- Built with Style Dictionary
Ratings & Reviews
No ratings yet
Be the first to rate @primer/primitives.
People also visit

@gainsight-hub/design-tokens
Design tokens: CSS variables, JSON, TypeScript constants, and Tailwind preset
@primer/primitives FAQ
What is Primer Primitives?
The colour, spacing and typography values for Primer, GitHub's design system. It is distributed on npm as @primer/primitives.
How do I use it?
Install it with npm and import the CSS files from dist/css. The values are available as CSS variables, and the README lists all the imports.
Do animated components need extra CSS?
Yes. The README says motion CSS imports are required for components with animations, such as the Spinner from @primer/react.
How are the tokens built?
Token data is kept in src/tokens and compiled with Style Dictionary through scripts/buildTokens.ts.
How do I add a colour mode?
Create an override file in the matching light or dark overrides folder, list only the changes from the main mode, and add the file to themes.config.ts.
What are the best @primer/primitives alternatives?
Popular alternatives to @primer/primitives include @gainsight-hub/design-tokens, @primer/view-components and @primer/react. See all @primer/primitives alternatives










