@stackoverflow/stacks 1.6.6 → 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 +10 -4
- package/dist/css/stacks.min.css +1 -1
- package/lib/css/components/buttons.less +8 -4
- package/lib/css/components/expandable.less +1 -1
- package/lib/test/s-tooltip.test.ts +62 -0
- package/lib/test/s-tooltip.visual.test.ts +31 -0
- package/package.json +27 -11
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
|
package/dist/css/stacks.css
CHANGED
|
@@ -1060,7 +1060,7 @@ pre.s-code-block::-webkit-scrollbar-corner {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
@supports ((-webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)) or (clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%))) {
|
|
1062
1062
|
.s-expandable:not(.is-expanded) .s-expandable--content {
|
|
1063
|
-
--_ex-content-o:
|
|
1063
|
+
--_ex-content-o: 0;
|
|
1064
1064
|
--_ex-content-transform: none;
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
@@ -21233,6 +21233,7 @@ body *:after {
|
|
|
21233
21233
|
--_bu-filled-bg: var(--theme-button-filled-background-color);
|
|
21234
21234
|
--_bu-filled-bg-active: var(--theme-button-filled-active-background-color);
|
|
21235
21235
|
--_bu-filled-bg-selected: var(--theme-button-filled-selected-background-color);
|
|
21236
|
+
--_bu-filled-bs: inset 0 var(--su-static1) 0 0 hsla(0, 0%, 100%, 0.7);
|
|
21236
21237
|
--_bu-filled-fc: var(--theme-button-filled-color);
|
|
21237
21238
|
--_bu-filled-fc-active: var(--theme-button-filled-hover-color);
|
|
21238
21239
|
--_bu-filled-fc-hover: var(--theme-button-filled-hover-color);
|
|
@@ -21267,12 +21268,14 @@ body *:after {
|
|
|
21267
21268
|
@media (prefers-color-scheme: dark) {
|
|
21268
21269
|
body.theme-system .s-btn {
|
|
21269
21270
|
--_bu-bs: none;
|
|
21271
|
+
--_bu-filled-bs: var(--_bu-bs);
|
|
21270
21272
|
}
|
|
21271
21273
|
}
|
|
21272
21274
|
body.theme-dark .s-btn,
|
|
21273
21275
|
.theme-dark__forced .s-btn,
|
|
21274
21276
|
body.theme-system .theme-dark__forced .s-btn {
|
|
21275
21277
|
--_bu-bs: none;
|
|
21278
|
+
--_bu-filled-bs: var(--_bu-bs);
|
|
21276
21279
|
}
|
|
21277
21280
|
body.theme-highcontrast .s-btn {
|
|
21278
21281
|
--_bu-bc: currentColor;
|
|
@@ -21284,6 +21287,7 @@ body.theme-highcontrast .s-btn {
|
|
|
21284
21287
|
.s-btn[disabled],
|
|
21285
21288
|
.s-btn[aria-disabled="true"] {
|
|
21286
21289
|
--_bu-bs: none !important;
|
|
21290
|
+
--_bu-filled-bs: var(--_bu-bs);
|
|
21287
21291
|
opacity: var(--_o-disabled-static);
|
|
21288
21292
|
pointer-events: none;
|
|
21289
21293
|
text-decoration: none;
|
|
@@ -21334,9 +21338,9 @@ body.theme-highcontrast .s-btn-group.s-btn-group--radio .s-btn--radio:checked +
|
|
|
21334
21338
|
box-shadow: none;
|
|
21335
21339
|
}
|
|
21336
21340
|
.s-btn.s-btn__filled {
|
|
21337
|
-
--_bu-bs: inset 0 var(--su-static1) 0 0 hsla(0, 0%, 100%, 0.7);
|
|
21338
21341
|
border-color: var(--_bu-filled-bc);
|
|
21339
21342
|
background-color: var(--_bu-filled-bg);
|
|
21343
|
+
box-shadow: var(--_bu-filled-bs);
|
|
21340
21344
|
color: var(--_bu-filled-fc);
|
|
21341
21345
|
}
|
|
21342
21346
|
.s-btn.s-btn__outlined {
|
|
@@ -21357,6 +21361,7 @@ body.theme-highcontrast .s-btn-group.s-btn-group--radio .s-btn--radio:checked +
|
|
|
21357
21361
|
--_bu-baw: 0;
|
|
21358
21362
|
--_bu-br: 0;
|
|
21359
21363
|
--_bu-bs: none;
|
|
21364
|
+
--_bu-filled-bs: var(--_bu-bs);
|
|
21360
21365
|
--_bu-focus-ring: none;
|
|
21361
21366
|
--_bu-p: 0;
|
|
21362
21367
|
text-decoration: none;
|
|
@@ -21462,6 +21467,7 @@ body.theme-highcontrast .s-btn.s-btn__link {
|
|
|
21462
21467
|
--_bu-bg: none;
|
|
21463
21468
|
--_bu-br: 0;
|
|
21464
21469
|
--_bu-bs: none;
|
|
21470
|
+
--_bu-filled-bs: var(--_bu-bs);
|
|
21465
21471
|
--_bu-fc: unset;
|
|
21466
21472
|
--_bu-focus-ring: none;
|
|
21467
21473
|
--_bu-p: 0;
|
|
@@ -21511,7 +21517,6 @@ body.theme-highcontrast .s-btn.s-btn__muted {
|
|
|
21511
21517
|
--_bu-bg-active: var(--red-100);
|
|
21512
21518
|
--_bu-bg-hover: var(--red-050);
|
|
21513
21519
|
--_bu-bg-selected: var(--red-200);
|
|
21514
|
-
--_bu-bs: inset 0 var(--su-static1) 0 0 hsla(0, 0%, 100%, 0.4);
|
|
21515
21520
|
--_bu-fc: var(--red-600);
|
|
21516
21521
|
--_bu-fc-active: var(--_bu-fc);
|
|
21517
21522
|
--_bu-fc-hover: var(--red-700);
|
|
@@ -21523,6 +21528,7 @@ body.theme-highcontrast .s-btn.s-btn__muted {
|
|
|
21523
21528
|
--_bu-filled-bg-active: var(--red-700);
|
|
21524
21529
|
--_bu-filled-bg-hover: var(--red-600);
|
|
21525
21530
|
--_bu-filled-bg-selected: var(--red-800);
|
|
21531
|
+
--_bu-filled-bs: inset 0 var(--su-static1) 0 0 hsla(0, 0%, 100%, 0.4);
|
|
21526
21532
|
--_bu-filled-fc: var(--white);
|
|
21527
21533
|
--_bu-filled-fc-active: var(--_bu-filled-fc);
|
|
21528
21534
|
--_bu-filled-fc-hover: var(--_bu-filled-fc);
|
|
@@ -21567,7 +21573,6 @@ body.theme-highcontrast.theme-dark .s-btn.s-btn__danger.s-btn__filled {
|
|
|
21567
21573
|
--_bu-bg-active: var(--black-050);
|
|
21568
21574
|
--_bu-bg-hover: var(--black-025);
|
|
21569
21575
|
--_bu-bg-selected: var(--black-075);
|
|
21570
|
-
--_bu-bs: inset 0 var(--su-static1) 0 0 hsla(0, 0%, 100%, 0.4);
|
|
21571
21576
|
--_bu-fc: var(--black-500);
|
|
21572
21577
|
--_bu-fc-active: var(--_bu-fc);
|
|
21573
21578
|
--_bu-fc-hover: var(--black-600);
|
|
@@ -21579,6 +21584,7 @@ body.theme-highcontrast.theme-dark .s-btn.s-btn__danger.s-btn__filled {
|
|
|
21579
21584
|
--_bu-filled-bg-active: var(--black-200);
|
|
21580
21585
|
--_bu-filled-bg-hover: var(--black-150);
|
|
21581
21586
|
--_bu-filled-bg-selected: var(--black-350);
|
|
21587
|
+
--_bu-filled-bs: inset 0 var(--su-static1) 0 0 hsla(0, 0%, 100%, 0.4);
|
|
21582
21588
|
--_bu-filled-fc: var(--black-700);
|
|
21583
21589
|
--_bu-filled-fc-active: var(--_bu-filled-fc);
|
|
21584
21590
|
--_bu-filled-fc-hover: var(--_bu-filled-fc);
|