@stackoverflow/stacks 1.6.5 → 1.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -2
- package/dist/css/stacks.css +157 -158
- package/dist/css/stacks.min.css +1 -1
- package/lib/css/components/activity-indicator.less +9 -5
- package/lib/css/components/avatars.less +14 -5
- package/lib/css/components/award-bling.less +2 -0
- package/lib/css/components/badges.less +25 -3
- package/lib/css/components/breadcrumbs.less +9 -5
- package/lib/css/components/button-groups.less +3 -0
- package/lib/css/components/buttons.less +35 -6
- package/lib/css/components/code-blocks.less +13 -0
- package/lib/css/components/empty-states.less +3 -3
- package/lib/css/components/expandable.less +61 -59
- package/lib/css/components/labels.less +12 -4
- package/lib/css/components/link-previews.less +19 -4
- package/lib/css/components/menu.less +4 -1
- package/lib/css/components/modals.less +5 -0
- package/lib/css/components/navigation.less +38 -46
- package/lib/css/components/notices.less +28 -7
- package/lib/css/components/pagination.less +2 -2
- package/lib/css/components/progress-bars.less +27 -5
- package/lib/css/components/prose.less +64 -22
- package/lib/css/components/sidebar-widgets.less +75 -67
- package/lib/css/components/spinner.less +21 -13
- package/lib/css/components/tags.less +21 -16
- package/lib/css/components/toggle-switches.less +12 -4
- package/lib/css/components/uploader.less +34 -16
- package/lib/css/components/user-cards.less +10 -1
- package/lib/test/s-tooltip.test.ts +62 -0
- package/lib/test/s-tooltip.visual.test.ts +31 -0
- package/package.json +30 -14
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# Stacks
|
|
2
2
|
|
|
3
|
+
[![ci status][gh-action-badge]][gh-action-url] [![npm version][npm-badge]][npm-url]
|
|
4
|
+
|
|
3
5
|
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.
|
|
4
6
|
|
|
5
7
|
Our documentation is built with Stacks itself, using its [immutable, atomic classes](http://johnpolacek.com/rethinking/) and components.
|
|
@@ -55,9 +57,47 @@ npm run lint:format
|
|
|
55
57
|
```
|
|
56
58
|
|
|
57
59
|
## Testing Stacks
|
|
58
|
-
Stacks has implemented visual regression testing with [Backstop](https://github.com/garris/BackstopJS). To test if your new feature introduces visual regressions, run `npm run test` in a new Terminal window while Stacks is running. After the tests have run, a new browser window with any regressions will show. If the regressions are desired, you can run `npm run approve` to establish the new baseline.
|
|
59
60
|
|
|
60
|
-
|
|
61
|
+
Run all test suites by running:
|
|
62
|
+
```sh
|
|
63
|
+
npm test
|
|
64
|
+
```
|
|
65
|
+
### Unit/Component Tests
|
|
66
|
+
|
|
67
|
+
Unit/Component tests are written with [DOM Testing Library](https://testing-library.com/docs/dom-testing-library/intro).
|
|
68
|
+
Please follow the library's principles and documentation to write tests.
|
|
69
|
+
|
|
70
|
+
Stacks 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.
|
|
71
|
+
|
|
72
|
+
Execute the unit/component tests suite by running:
|
|
73
|
+
```sh
|
|
74
|
+
npm run test:unit
|
|
75
|
+
```
|
|
76
|
+
or if you prefer watch mode run:
|
|
77
|
+
```sh
|
|
78
|
+
npm run test:unit:watch
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Visual Regression Tests
|
|
82
|
+
|
|
83
|
+
**Prerequisite:**
|
|
84
|
+
In order to pull and upload baseline images you need to have `git lfs` installed in your local machine. Please follow [this guide](https://docs.github.com/en/repositories/working-with-files/managing-large-files/installing-git-large-file-storage) to install that.
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
This [Web Test Runner plugin](https://www.npmjs.com/package/@web/test-runner-visual-regression) is used to run visual regression tests. [DOM Testing Library](https://testing-library.com/docs/dom-testing-library/intro).
|
|
88
|
+
Visual regression tests end with this suffix `*.visual.test.ts`.
|
|
89
|
+
|
|
90
|
+
Execute the visual regression tests suite by running:
|
|
91
|
+
```sh
|
|
92
|
+
npm run test:visual
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Update the visual baseline via:
|
|
96
|
+
```sh
|
|
97
|
+
npm run test:visual:update
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Failing tests (including diffs) can be found under `screenshots/[browser]/failed/` folders.
|
|
61
101
|
|
|
62
102
|
## Bugs and feature requests
|
|
63
103
|
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](/CONTRIBUTING.md#open-an-issue) for submitting [a bug report](/CONTRIBUTING.md#reporting-bugs) or [feature request](/CONTRIBUTING.md#feature-requests).
|
|
@@ -67,3 +107,8 @@ If you’d like to contribute to Stacks, please read through our [contribution g
|
|
|
67
107
|
|
|
68
108
|
## License
|
|
69
109
|
Code and documentation copyright 2017-2022 Stack Exchange, Inc and released under the [MIT License](/LICENSE.MD).
|
|
110
|
+
|
|
111
|
+
[gh-action-url]: https://github.com/StackExchange/Stacks/actions/workflows/main.yml
|
|
112
|
+
[gh-action-badge]: https://github.com/StackExchange/Stacks/actions/workflows/main.yml/badge.svg?branch=develop
|
|
113
|
+
[npm-url]: https://npmjs.org/package/@stackoverflow/stacks
|
|
114
|
+
[npm-badge]: https://img.shields.io/npm/v/@stackoverflow/stacks.svg
|