Thanks for your interest in improving Construct! This guide explains how to get set up and what we expect from contributions.
This project follows the Contributor Covenant. By participating, you agree to uphold it.
git clone https://github.com/Samyssmile/construct.git
cd construct
npm install
npm run storybook # dev server at http://localhost:6006tokens/ Source design tokens (JSON) + build pipeline
components/ One CSS file per component (ct- prefix, BEM modifiers)
foundations.css Reset, typography & layout utilities
stories/ Storybook stories (also drive the tests)
docs/ Guidelines & best practices
scripts/ Token build script (build-tokens.mjs)
Tokens are the single source of truth. Never hand-edit generated files
(tokens/tokens.css, tokens/tokens.json, tokens/tokens.ts, tokens/tokens.js).
- Edit the source JSON:
tokens/primitives.jsonortokens/semantic.*.json - Run
npm run buildto regenerate outputs npm run checkverifies outputs are in sync (also runs in CI)
- Naming:
ct-prefix with BEM modifiers —ct-button,ct-button__icon,ct-button--secondary - Sizes:
--sm, default (md),--lg - State: data attributes (
data-state="open") and ARIA (aria-invalid,aria-selected,aria-disabled) - One CSS file per component in
components/, imported viacomponents/index.css - 2-space indentation; CSS custom properties in kebab-case (
--color-brand-primary)
Every component must:
- Use semantic HTML and correct ARIA attributes
- Support full keyboard navigation with visible focus
- Meet WCAG 2.1 AA contrast in light, dark, and high-contrast themes
The Storybook a11y addon fails the build on violations — please add/update a story so your component is covered. See docs/guidelines.md.
Tests are story-driven (Vitest + Playwright via @storybook/addon-vitest):
npx vitest --runAdd coverage by creating or updating a *.stories.js file.
We use Conventional Commits:
feat: add tree component
fix(button): correct focus ring offset in high-contrast
docs: clarify token build steps
Common types: feat, fix, docs, chore, refactor, test.
- Fork & branch from
main - Make your change (tokens rebuilt, stories added, a11y passing)
- Run
npm run checkandnpx vitest --run - Open a PR using the template and describe the change & motivation
Thank you for contributing! 🧡