{"id":28384756,"url":"https://github.com/stackexchange/stacks","last_synced_at":"2025-06-26T00:33:15.093Z","repository":{"id":37484106,"uuid":"109884266","full_name":"StackExchange/Stacks","owner":"StackExchange","description":"Stack Overflow’s Design System","archived":false,"fork":false,"pushed_at":"2025-06-23T19:42:54.000Z","size":1049277,"stargazers_count":639,"open_issues_count":71,"forks_count":96,"subscribers_count":23,"default_branch":"develop","last_synced_at":"2025-06-23T20:22:48.632Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://stackoverflow.design","language":"Less","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StackExchange.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.MD","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-11-07T19:58:36.000Z","updated_at":"2025-06-23T19:42:58.000Z","dependencies_parsed_at":"2023-11-15T11:26:50.597Z","dependency_job_id":"e7c1f6a0-4815-41c5-b099-4a2d5911cc38","html_url":"https://github.com/StackExchange/Stacks","commit_stats":{"total_commits":4606,"total_committers":59,"mean_commits":78.0677966101695,"dds":0.4333478072079896,"last_synced_commit":"23b645bfdd6ecfe86c07de42ecf216dd64d578f7"},"previous_names":[],"tags_count":250,"template":false,"template_full_name":null,"purl":"pkg:github/StackExchange/Stacks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackExchange%2FStacks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackExchange%2FStacks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackExchange%2FStacks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackExchange%2FStacks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StackExchange","download_url":"https://codeload.github.com/StackExchange/Stacks/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackExchange%2FStacks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261977531,"owners_count":23239367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-30T09:30:49.398Z","updated_at":"2025-06-26T00:33:15.082Z","avatar_url":"https://github.com/StackExchange.png","language":"Less","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stacks\n\n[![ci status][gh-action-badge]][gh-action-url] [![npm version][npm-badge]][npm-url]\n\nStacks 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.\n\nOur documentation is built with Stacks itself, using its [immutable, atomic classes](http://johnpolacek.com/rethinking/) and components.\n\nThe Stacks website documents:\n\n### Product\n- Semantic and accessible component markup\n- Cross-browser compatible Less / CSS\n- An [icon library](https://github.com/StackExchange/Stacks-Icons)\n\n### Email\n- Email templates \u0026 components\n\nStacks documentation can be found at https://stackoverflow.design/\n\n## Table of contents\n\n- [Using Stacks](#using-stacks)\n- [Migrating from v1 to v2](#migrating-from-v1-to-v2)\n- [Building Stacks](#building-stacks)\n- [Format Stacks](#format-stacks)\n- [Linting Stacks](#linting-stacks)\n- [Testing Stacks](#testing-stacks)\n- [Releasing Stacks](#releasing-a-new-version-of-stacks)\n- [Bugs and feature requests](#bugs-and-feature-requests)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Using Stacks\nUsing Stacks is outlined in our [usage guidelines](https://stackoverflow.design/product/develop/using-stacks).\n\n## Migrating from v1 to v2\n\nTo migrate from Stacks v1 to v2, see our [migration guide](/MIGRATION_GUIDE.md).\n\n## Building Stacks\nTo contribute to Stacks documentation or its CSS library, you’ll need to build Stacks locally. View our [building guidelines](https://stackoverflow.design/product/develop/building).\n\nHaving trouble getting these steps to work? Open [an issue](https://github.com/StackExchange/Stacks/issues/new) with a `setup` label.\n\n## Format Stacks\n\nFormat the source code with prettier via running:\n```sh\nnpm run format\n```\n\n## Linting Stacks\n\nRun all lint suites by running:\n```sh\nnpm run lint\n```\n\nLint the styles (stylelint) by running:\n```sh\nnpm run lint:css\n```\nLint the typescript source code (eslint) via running:\n```sh\nnpm run lint:ts\n```\nLint the source code format (prettier) via running:\n```sh\nnpm run lint:format\n```\n\n## Testing Stacks\n\nRun all test suites by running:\n```sh\nnpm test\n```\n### Unit/Component Tests\n\nUnit/Component tests are written with [DOM Testing Library](https://testing-library.com/docs/dom-testing-library/intro).\nPlease follow the library's principles and documentation to write tests.\n\nStacks uses [Web Test Runner](https://modern-web.dev/docs/test-runner/overview/) and [Playwright](https://modern-web.dev/docs/test-runner/browser-launchers/playwright/) to run tests in a real browser context.\n\nExecute the unit/component tests suite by running:\n```sh\nnpm run test:unit\n```\nor if you prefer watch mode run:\n```sh\nnpm run test:unit:watch\n```\n\n### Visual Regression Tests\n\n**Prerequisites:** \n- `git lfs` ([installation docs](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage))\n- `docker` ([installation docs](https://docs.docker.com/engine/install/))\n- `pwsh` ([Installation docs](https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.3))\n- Run `git config diff.lfs.textconv cat` to make sure image diff works as expected ([More info](https://github.com/microsoft/vscode/issues/86611#issuecomment-875894108))\n\nThis [Web Test Runner plugin](https://www.npmjs.com/package/@web/test-runner-visual-regression) is used to run visual regression tests.\nVisual regression tests end with this suffix `*.visual.test.ts`.\n\nExecute the visual regression tests suite by running:\n```sh\nnpm run test:visual\n```\nAfter the first run, if there are failing snapshots, they end up overriding the baseline ones in the filesystem (e.g. `/screenshots/\u003cbrowser\u003e/baseline/\u003cname\u003e.png`). \nWe do this for easier comparison of the dif directly in vscode and to make sure only the failing snapshots get regenerated (see [this GH discussion](https://github.com/modernweb-dev/web/discussions/427#discussioncomment-3543771) that inspired the approach).\n\nWe also recommend to install [this vscode extension](https://marketplace.visualstudio.com/items?itemName=RayWiis.png-image-diff) for getting better diffs.\n\n### Less Tests\n\nThis is an experimental suite to test the generation of CSS from Less files. \nLess tests end with this suffix `*.less.test.ts`.\n\nExecute the less tests suite by running:\n```sh\nnpm run test:less\n```\n\nUpdate the css snapshots via:\n```sh\nnpm run test:less:update\n```\n\n## Releasing a new version of Stacks\nStacks uses [Semantic Versioning](https://semver.org/), is distributed via [npm](https://www.npmjs.com/package/@stackoverflow/stacks), and publishes [release notes on Github](https://github.com/StackExchange/Stacks/releases). \n\nWe use [changesets](https://github.com/changesets/changesets) to automatize the steps necessary to publish to NPM, create GH releases and a changelog.\n\n- Every time you do work that requires a new release to be published, [add a changesets entry](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md) by running `npx chageset` and follow the instrcutions on screen. (changes that do not require a new release - e.g. changing a test file - don't need a changeset).\n    - When opening a PR without a corresponding changeset the [changesets-bot](https://github.com/apps/changeset-bot) will remind you to do so. It generally makes sense to have one changeset for PR (if the PR changes do not require a new release to be published the bot message can be safely ignored)\n- The [release github workflow](.github/workflows/release.yml) continuosly check if there are new pending changesets in the main branch, if there are it creates a GH PR (`chore(release)` [see example](https://github.com/StackExchange/apca-check/pull/2)) and continue updating it as more changesets are potentially pushed/merged to the main branch.\n- When we are ready to cut a release we need to simply merge the `chore(release)` PR back to main and the release github workflow will take care of publishing the changes to NPM and create a GH release for us. The `chore(release)` PR also give us an opportunity to adjust the automatically generated changelog when necessary (the entry in the changelog file is also what will end up in the GH release notes).\n\n_The release github workflow only run if the CI workflow (running linter, formatter and tests) is successful: CI is blocking accidental releases_.\n\n_Despite using changesets to communicate the intent of creating releases in a more explicit way, we still follow [conventional commits standards](https://www.conventionalcommits.org/en/v1.0.0/) for keeping our git history easily parseable by the human eye._\n\nSuccessful releases trigger automatically a new deployment to stackoverflow.design by merging the `develop` branch into the `production` branch.\n\n## Bugs and feature requests\nHave 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](/CONTRIBUTING.md#open-an-issue) for submitting [a bug report](/CONTRIBUTING.md#reporting-bugs) or [feature request](/CONTRIBUTING.md#feature-requests).\n\n## Contributing\nIf you’d like to contribute to Stacks, please read through our [contribution guidelines](/CONTRIBUTING.md). Included are directions for opening issues, coding standards, and notes on development.\n\n## License\nCode and documentation copyright 2017-2024 Stack Exchange, Inc and released under the [MIT License](/LICENSE.MD).\n\n[gh-action-url]: https://github.com/StackExchange/Stacks/actions/workflows/main.yml\n[gh-action-badge]: https://github.com/StackExchange/Stacks/actions/workflows/workflow.yml/badge.svg?branch=develop\n[npm-url]: https://npmjs.org/package/@stackoverflow/stacks\n[npm-badge]: https://img.shields.io/npm/v/@stackoverflow/stacks.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackexchange%2Fstacks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackexchange%2Fstacks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackexchange%2Fstacks/lists"}