Project
Contributing
Small, careful changes with tests. This page is rendered from CONTRIBUTING.md.
Thank you for considering a contribution. Halora is the Origin Labs design system, and five live sites depend on it, so changes are small, tested, and explained.
Getting started
- Fork the repository and clone it.
- Install with
npm ci. - Build the package and the site with
npm run build:all. - Preview the site with
npm run serveand open http://localhost:4173.
Branch model
This repository uses GitFlow. develop is the integration branch and main is stable. All work happens on short-lived branches off develop.
| Branch | Purpose | Merges into |
|---|---|---|
main | Stable. Every push builds and publishes the site image. | release target |
develop | Integration branch. | main through a release PR |
feat/* | New features. | develop through a PR |
fix/* | Bug fixes. | develop through a PR |
docs/* | Documentation only. | develop through a PR |
chore/* | Dependencies, CI, tooling. | develop through a PR |
Commit messages
Use Conventional Commits in English: feat:, fix:, docs:, chore:, refactor:, test:. Write the subject in the imperative mood, in lowercase after the type, with no trailing period. Do not add AI attribution or co-author footers to commits or pull requests.
Text rules
- Everything in git and GitHub is in English: branches, commits, pull requests, and docs.
- Do not use em dash characters anywhere.
npm run lint:textfails the build if it finds one.
Tests and gates
Run these before you push:
npm run lint:text
npm test
npm run build
npm run size
npm run build:all
npm run a11ynpm testincludes the contrast gate. Every text and background pair that components use must reach 4.5:1 (3:1 for large text and the focus ring) in light and dark, for every brand.npm run sizeenforces the budget: all CSS under 20 kB gzipped and all JavaScript under 8 kB gzipped.npm run a11yruns axe through Playwright against the built site, in both themes. It needs a Chromium binary. SetCHROMIUM_PATHif it is not at/usr/bin/chromium.
New behavior needs new tests. Behavior modules are tested with a small DOM fake in test/helpers/fake-dom.mjs.
Add a component
- Create
src/css/components/<name>.css. Wrap everything in@layer ha-components { ... }. - Prefix every class with
ha-, use BEM-like modifiers (ha-thing--variant,ha-thing__part), and take every color, radius, shadow, easing, and duration from a--ha-*token. - Check both themes and both brands, and apply the mobile rules: icon and label pairs stay inline, touch targets reach 44px on phones, and nothing overflows at 320px.
- Add the file name to
COMPONENTSinscripts/lib.mjs. - If the component uses a new text and background pair, add it to
test/tokens.test.mjs. - Document it in
site/pages/components-a.mjsorcomponents-b.mjswith live demos, a class table, accessibility notes, and do and don't guidance. Add the page key tosite/nav.mjs. - Add a line to
CHANGELOG.mdunder Unreleased.
Add a brand
- Add an entry to
brandsintokens/index.mjs. Define completelightanddarkcolor sets (spread an existing set and override what differs) and the three font families. - Run
npm test. The contrast gate reports any pair that fails and by how much. - Run
npm run build. This writesdist/brands/<id>.cssand a full bundle indist/bundles/. - Add the brand to the documentation site: the brand switch in
site/lib/layout.mjsand a section insite/pages/tokens.mjs.
Pull request process
- Branch from
develop. - Make sure the checks above pass.
- Open a pull request into
develop, assigned to @mateuseap, with this body:
#### Changes made
- bulletReleases
See docs/release-process.md. Maintainers merge to main, tag vX.Y.Z, and the release workflow attaches the tarball.