Contributing to domestic-ui
From CONTRIBUTING.md; edit CONTRIBUTING.md on GitHub.
Thanks for helping. This project is a design system built on native HTML, CSS tokens, and published web standards.
Issues and pull requests
All work is tracked as GitHub issues, grouped into milestones in roadmap order and shown on the project board. Use the issue forms for bugs and feature requests. Pull requests use the template.
To pick up an issue:
- Comment on it first, so two people don't do the same work.
good first issueandhelp wantedare good places to start. - Check that any issue listed under "Blocked by" is closed.
- Open a pull request whose body says
Fixes #<number>, so the issue closes when the PR merges.
Work you notice along the way becomes a new issue rather than growing the current pull request.
Labels you will see: bug, enhancement, docs, a11y, tokens, demos, good first issue and help wanted (about labels).
Branch names follow fix/…, feat/…, docs/…, a11y/…, ci/…, build/… or chore/…, each with a short description.
Reviews
Every pull request, from inside or outside the project, gets the same review and must pass CI before it merges. GitHub holds CI on a first-time contributor's pull request until a maintainer approves the workflow run.
A pull request squash-merges once it is approved and CI is green. The ruleset requires the branch to be up to date with main, so merge main into it when it is behind or has a conflict, and otherwise leave it alone.
.github/CODEOWNERS lists @odonckers on every file. That file is informational today. Team bots push with the same GitHub account as Owen, so GitHub cannot tell his review apart from a bot's.
Standards
- Prefer a native HTML element before adding a component or custom behavior.
- Check visual and interaction changes against the design principles, and say in the pull request which ones apply.
- Cite the relevant MDN, WHATWG, W3C, WCAG 2.2, or APG documentation in the issue or pull request.
- If we choose a behavior the specs leave open, label it as our choice, not as a standard.
- Theme only through semantic
--dui-*CSS custom properties. Do not hard-code colors, spacing, typography, or other design values in components.
The default theme should look complete and consistent with no overrides. Consumers re-theme the system by overriding those tokens.
Dependencies
The published CSS and web components have no runtime dependencies. Every external dependency (npm packages in the
root and in each demo app, GitHub Actions and container images) comes with a security review and a row in
docs/DEPENDENCIES.md, in the same pull request. npm run lint:deps (part of npm test
and CI) fails when one is missing or when a row names something no longer used.
Checks
npm test must pass. That run includes html-validate, axe, and stylelint. On Linux it also compares the screenshot baselines.
Screenshot baselines
tests/visual.spec.js records Chromium screenshots of the docs home and the button, field, card, dialog (open), data table, nav and app shell examples, plus the themes page. Each page is shot at 1280×800 and 390×844, in light, dark and forced colors. The two widths are the reflow check from WCAG 2.2 1.4.10. Comparisons use Playwright's toHaveScreenshot().
Baselines live in tests/__screenshots__/. They are Linux images. On any other operating system the spec skips unless VISUAL=1 is set, so a macOS npm test does not fail on font rendering. Update the baselines in the same pull request as the visual change. On Linux:
npm run test:visual:update
To match the CI browser, run that in the Playwright image named in .github/workflows/ci.yml (the tag matches @playwright/test in package.json):
docker run --rm -v "$PWD":/work -w /work -u "$(id -u):$(id -g)" mcr.microsoft.com/playwright:v1.65.1-noble bash -lc "npm ci && npm run test:visual:update"
A prebuilt theme adds an entry to themeScopes in the spec and commits the new images with the same command.
Alignment passes
To check or fix how items line up (sidebars, nav, toolbars, menus, tabs, dialogs, tables, page headers), use the
vendored gridlines skill: read
.claude/skills/gridlines/DOMESTIC-UI.md first, then
.claude/skills/gridlines/SKILL.md. Its rules are our choice, not a standard.
The target lines are in PRINCIPLES.md § 13. Measure with
npm run gridlines -- examples/app-shell.html (a manual tool, not part of npm test).
Commits and PR titles
Every commit follows Conventional Commits 1.0:
type(scope): description, lowercase.
- Types:
feat,fix,docs,style,refactor,perf,test,build,ci,chore,revert. - The scope is optional and free-form lowercase, for example
css,tokens,examples,web-components,docs,demos,ciordeps. - The description starts lowercase (a proper noun later in the line is fine) and the whole header is at most 100
characters. Mark a breaking change with
!after the type or scope, or aBREAKING CHANGE:footer.
feat(css): add toolbar density tokens
fix(nav): keep the marker on aria-current
docs: link the apg tabs pattern
We squash-merge, so the pull request title becomes the commit on main. The title must follow the same rule.
CI's lint job lints the title and every commit in the pull request with commitlint
(commitlint.config.mjs), and the required ci check fails if it does. Retitling a pull
request re-runs CI. Merge commits such as "Merge branch 'main' into …" are ignored. To check a message locally:
echo "fix(nav): keep the marker on aria-current" | npx commitlint.
Changelog
CHANGELOG.md is generated from the commits on main by npm run changelog (git-cliff,
cliff.toml) at release time. Never edit it by hand, and do not add changelog entries in pull
requests. The commit message is the entry. npm run changelog:check fails if the file is out of date. The section
written by hand before Conventional Commits is kept as it is.
Versioning
Versions follow Semantic Versioning 2.0.0. These are the public API, and changing or removing any of them is a breaking change:
- semantic tokens and knobs in
css/tokens/semantic.css(primitives incss/tokens/primitives.cssare internal and may change in any release); - each component's
data-<component>attribute and its words (data-button="secondary small"); - each component part's
data-<component>-<part>attribute and its words (data-table-cell="number"); - the scope attributes
data-theme,data-color-scheme,data-density,data-motionanddata-contrast, and their values; - the markup contract of each component: which native elements, attributes and ARIA states it expects;
- custom element names, their attributes, properties, methods and events (
dui-*); - every file path under
css/andweb-components/; - the names of the snippets in
examples/.
Breaking also covers raising the supported browsers so that one of them loses the core look, and retiring a web
component. A breaking change is marked with ! or a BREAKING CHANGE: footer and merges only with the
maintainer's approval.
- Before 1.0: a breaking change bumps the minor version (0.x.0); everything else bumps the patch.
- Deprecation: a deprecated token, attribute word or element keeps working for at least one minor release, is marked Deprecated in its documentation with its replacement, and is removed in a later minor release.
- Visual changes to the default theme are not breaking, but release notes call them out and the screenshot tests cover them.
- 1.0 comes when the semantic tokens, the attribute vocabulary and the web component APIs have gone one full minor
release with no breaking change, every component has a docs page in MDN structure, and every framework demo passes
the shared accessibility checks.
docs/ARCHITECTURE.mdhas the reasoning.
Releasing
Versions follow Semantic Versioning 2.0.0, and the changelog follows Keep a Changelog 1.1.0. Releases happen only when the maintainer asks.
- Open a
chore(release): prepare X.Y.Zpull request that setsversioninpackage.json(andpackage-lock.json, withnpm version X.Y.Z --no-git-tag-version) and runsnpm run changelog -- --tag vX.Y.Z. That files every unreleased commit underX.Y.Zbefore the tag exists (git-cliff--tag) and leaves an empty[Unreleased]above it. Commit its output unedited.npm run changelog:check -- --tag vX.Y.Zchecks it. - git-cliff dates the new section today (UTC), so generate it on the day the pull request merges, and regenerate it if the merge slips to another day.
- After it merges, create an annotated tag on the merge commit on
mainand push it:git tag -a vX.Y.Z -m "vX.Y.Z" <merge-sha> && git push origin vX.Y.Z. From then on, plainnpm run changelogandnpm run changelog:checksee the tag and produce the same section. - Publish a GitHub release named
vX.Y.Zfrom that tag, with theX.Y.Zchangelog section as its notes. - Pushing the tag runs
.github/workflows/release.yml, which checks that the tag matchesversioninpackage.jsonand publishes the package to npm with trusted publishing and a provenance statement. The repository holds no npm token. Thefilesandexportsfields inpackage.jsondecide what ships:css/,web-components/,llms.txt,llms-full.txtandCHANGELOG.md; check withnpm pack --dry-run.
The first publish of a new package name can't use trusted publishing, because npm sets up a trusted
publisher only on a package that exists. The maintainer publishes that one version from their own signed-in
npm session (npm publish on the tagged commit), then adds this repository and release.yml as the trusted
publisher in the package settings on npmjs.com. Every later release publishes from the tag.