Stacks is Stack Overflow’s design system. It includes the resources needed to create consistent, predictable interfaces and workflows that conform to Stack Overflow’s principles, design language, and best practices.
Our documentation is built with Stacks itself, using its immutable, atomic classes and components.
The Stacks website documents:
- Semantic and accessible component markup
- Cross-browser compatible Less / CSS
- An icon library
- Email templates & components
Stacks documentation can be found at https://stackoverflow.design/
- Using Stacks
- Building Stacks
- Format Stacks
- Linting Stacks
- Testing Stacks
- Releasing Stacks
- Bugs and feature requests
- Contributing
- License
Using Stacks is outlined in our usage guidelines.
To contribute to Stacks documentation or its CSS library, you’ll need to build Stacks locally. View our building guidelines.
Having trouble getting these steps to work? Open an issue with a setup label.
Format the source code with prettier via running:
npm run formatRun all lint suites by running:
npm run lintLint the styles (stylelint) by running:
npm run lint:cssLint the typescript source code (eslint) via running:
npm run lint:tsLint the source code format (prettier) via running:
npm run lint:formatRun all test suites by running:
npm testUnit/Component tests are written with DOM Testing Library. Please follow the library's principles and documentation to write tests.
Stacks uses Web Test Runner and Playwright to run tests in a real browser context.
Execute the unit/component tests suite by running:
npm run test:unitor if you prefer watch mode run:
npm run test:unit:watchPrerequisites:
git lfs(installation docs)docker(installation docs)pwsh(Installation docs)
This Web Test Runner plugin is used to run visual regression tests. DOM Testing Library.
Visual regression tests end with this suffix *.visual.test.ts.
Execute the visual regression tests suite by running:
npm run test:visualUpdate the visual baseline via:
npm run test:visual:updateFailing tests (including diffs) can be found under screenshots/[browser]/failed/ folders.
Stacks uses Semantic Versioning, is distributed via npm, and publishes release notes on Github. Follow the steps below to release a new version of Stacks.
npm version [major | minor | patch]git push && git push --tagsCreate release notes on Github
- Visit https://github.com/StackExchange/Stacks/releases/new
- Choose your new version from the "Choose a tag" dropdown
- Click "Generate release notes"
- Cleanup and complete the release notes
- Prominently mention any breaking changes, if applicable
- Include a "What's Changed" section in the release notes
- Mention significant bug fixes
- Mention new features
- Mention significant under-the-hood changes that could impact consumers
Ship your newly created version to npm
npm publishgit checkout production && git merge develop && git pushHead to Netlify, navigate to the Stacks overview, click on "Production deploys", and select "Deploy site" from the "Trigger deploy" dropdown.
Have a bug or feature request? First search existing or closed issues to make sure the issue hasn’t been noted yet. If not, review our issue guidelines for submitting a bug report or feature request.
If you’d like to contribute to Stacks, please read through our contribution guidelines. Included are directions for opening issues, coding standards, and notes on development.
Code and documentation copyright 2017-2022 Stack Exchange, Inc and released under the MIT License.