@massds/mds-tokens
v1.0.0
Published
Design tokens for the Massachusetts Design System
Readme
Massachusetts Design System Tokens
CSS design tokens for the Massachusetts Design System. This package publishes CSS variable files that can be imported into applications, component libraries, and other front-end builds.
For general guidance on how to use the Design System, check out the Design System Microsite.
Installation
npm install @massds/mds-tokensPackage Contents
The published package includes token files under dist/:
dist/
├── index.css
└── primitives.cssdist/index.csscontains the semantic tokens intended for application usedist/primitives.csscontains lower-level primitive tokens used to build the semantic layer (Do not reference directly)
Usage
Import the semantic token file from your CSS entrypoint:
@import "@massds/mds-tokens/dist/index.css";Use index.css as the public entrypoint for the package. Applications should not reference primitives.css directly, primitive values are for theming and may change as the design system evolves.
Source Layout
Source files live under src/ and are copied into dist/ during the build:
src/
├── index.css
└── primitives.cssThe test-page/ directory is only for local validation and is not published to npm.
Development
Install dependencies, lint the source files, and then build the distributable files from this package directory:
npm install
npm run lint
npm run buildIndividual lint commands:
npm run lint:css
npm run lint:htmlThe build copies the CSS token source files from src/ into dist/.
Publishing
The package is published to npm as @massds/mds-tokens with the GitHub Actions workflow at .github/workflows/publish-tokens.yml.
Recommended branch and tag strategy for tokens:
- Use
mainas the long-lived release branch for@massds/mds-tokens. - Merge tokens release work into
mainthrough a pull request with required checks. - Create tokens release tags only from commits already on
main. - Use the
tokens-v*tag prefix for every tokens release.
Tokens release flow:
- Create a release branch from
main, based on semantic versioning, for examplerelease/tokens-1.0.0 - Update
packages/tokens/package.jsonto the release version - Run
npm run changelog:release -- <version> <date>frompackages/tokens, or omit arguments to use the version frompackage.jsonand today’s date - Merge the release branch into
mainthrough a pull request - In the GitHub UI, create the release tag for the merged release commit using the format
tokens-v*, for exampletokens-v1.0.0 - In the GitHub Release for that tag, copy the relevant release notes from
packages/tokens/CHANGELOG.md - Creating the tag in GitHub triggers
.github/workflows/publish-tokens.ymlto publish the package
- Stable releases use tags such as
tokens-v1.0.0and publish to the npmlatestdist-tag. - Prereleases use tags such as
tokens-v1.1.0-beta.1and publish to the npmbetadist-tag.
Questions? Email the Massachusetts Design System Team at [email protected]
