Development
Tools
- Tailwind is our CSS framework, and provides a theme-able suite of utilities that form the backbone of our CSS system.
- postcss is our CSS compiler
- Babel is our JavaScript compiler
- This documentation is built with Docusaurus
Layout
All of the source files for the published design system packages live in subdirectories of packages.
Source files for this web site live in website/docs.
Workflow
Setup
- Get Node.js version 14 or greater
- Clone this repository with git
- Run
npm install
to install the dependencies
Develop
First, make sure that everything in your development environment is working by running:
npm run build
This should create .css
files in the css
directory, index.js
and
index.mjs
in the react
and elements
directories, and a static website in
the public
directory. Once you've confirmed that it's working, you can run one
or both of the following:
npm run watch
watches the source files and rebuilds the CSS and JavaScript bundles when they changenpm run develop
starts the Docusaurus server, which includes some helpful reloading and debugging features
Code style
- We lint our JavaScript with ESlint and the eslint-plugin-sfgov preset.
- We lint our CSS with stylelint.
- We lint shell (bash) scripts with shellcheck.