So you want to contribute to MLTSHP… Congratulations! Here's what you'll need to know.
We use the "fork and pull" model, which means you'll need to start by forking our repo, then make some changes, and then submit a pull request back to the main repo.
- Fork this repo.
- Run
npm ci
to install dependencies. - Run
npm run storybook
to start a local instance of Storybook, our preview site.
Any changes you make should automatically be reflected in the preview site.
The output of this project is CSS patterns and components. We generate that CSS using Sass and PostCSS.
The CSS depends on JSON tokens, which are converted into CSS custom properties and Sass variables using a tool called Style Dictionary.
And finally, we use Storybook to preview, test, and develop our CSS components in isolation without worrying about app specific dependencies and requirements.
Our PostCSS setup is minimal. We're running postcss-inline-svg to convert SVGs in the CSS into inline code, and we're running cssnano to minify the final output.
Design tokens are stored in JSON files in the src/tokens/
directory. The build process will automatically translate the tokens to the formats we're consuming, such as CSS custom properties.
Need help with how Storybook works? Check out the Storybook Docs.
We run Stylelint against Sass files, ESLint against JS files, and Prettier against all files. Linting will be run automatically against any pull requests.
You'll want to create a pull request from a fork of this repo. Once you do, we'll review your code, suggest changes, and eventually merge them! Then your changes will be available for anyone using the package, including the main MLTSHP site!
Only admins need to worry about these step.
git checkout main
git pull
- Make sure you have a clean working tree (
git status
should show no changes) npm ci
npm run lint:check
npm version
npm publish
- This will automatically install and compile everything, run linting, and publishgit push && git push --tags
npm run build
- Copy the minified CSS files from the
dist
folder to thestatic/css
folder in the MLTSHP repo. - Open a new PR for the updated CSS files.