@stackoverflow/stacks 1.4.2 → 1.6.0

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.
Files changed (31) hide show
  1. package/dist/css/stacks.css +3565 -2093
  2. package/dist/css/stacks.min.css +1 -1
  3. package/lib/css/atomic/colors.less +1 -1
  4. package/lib/css/atomic/flex.less +53 -2
  5. package/lib/css/components/activity-indicator.less +3 -3
  6. package/lib/css/components/badges.less +11 -11
  7. package/lib/css/components/button-groups.less +59 -83
  8. package/lib/css/components/buttons.less +384 -585
  9. package/lib/css/components/code-blocks.less +98 -125
  10. package/lib/css/components/expandable.less +69 -59
  11. package/lib/css/components/inputs.less +38 -24
  12. package/lib/css/components/link-previews.less +110 -122
  13. package/lib/css/components/links.less +0 -16
  14. package/lib/css/components/modals.less +95 -120
  15. package/lib/css/components/notices.less +187 -180
  16. package/lib/css/components/popovers.less +132 -181
  17. package/lib/css/components/post-summary.less +0 -9
  18. package/lib/css/components/progress-bars.less +236 -297
  19. package/lib/css/components/prose.less +293 -380
  20. package/lib/css/components/sidebar-widgets.less +251 -0
  21. package/lib/css/components/spinner.less +54 -104
  22. package/lib/css/components/tables.less +0 -24
  23. package/lib/css/components/toggle-switches.less +69 -120
  24. package/lib/css/components/topbar.less +10 -11
  25. package/lib/css/components/user-cards.less +91 -144
  26. package/lib/css/stacks-dynamic.less +0 -1
  27. package/lib/css/stacks-static.less +1 -1
  28. package/package.json +11 -11
  29. package/lib/css/components/_styles-template.less +0 -78
  30. package/lib/css/components/widget-dynamic.less +0 -33
  31. package/lib/css/components/widget-static.less +0 -274
@@ -1,197 +1,148 @@
1
- //
2
- // STACK OVERFLOW
3
- // POPOVERS
4
- //
5
- // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
- // Stack Overflow. For documentation of all these classes and how to contribute,
7
- // visit https://stackoverflow.design/
8
- //
9
- // TABLE OF CONTENTS
10
- // • VARIABLES
11
- // • BASE STYLE
12
- // • ARROWS
13
- // • LOCATIONS
14
- //
15
- // ============================================================================
16
- // $ BASE STYLES
17
- // ----------------------------------------------------------------------------
18
1
  .s-popover {
19
- display: none;
20
- position: absolute;
21
- max-width: 24rem;
22
- padding: var(--su12);
23
- z-index: var(--zi-popovers);
24
- border-radius: var(--br-md);
25
- border: 1px solid var(--bc-medium);
26
- background-color: var(--white);
27
- box-shadow: var(--bs-md);
28
- color: var(--fc-dark);
29
- font-size: var(--fs-body1);
30
- min-width: 12rem;
31
- width: 100%;
32
-
33
- // Guard against popovers being in a container with white-space: nowrap
34
- // Without this, the content pops *out* of the popover.
35
- white-space: normal;
36
-
2
+ --_po-bg: var(--white);
3
+ --_po-bc: var(--bc-medium);
4
+ --_po-bs: var(--bs-md);
5
+ --_po-d: none;
6
+ --_po-wmn: 12rem;
7
+ --_po-w: 100%;
8
+ // arrow
9
+ --_po-arrow-fc: var(--white);
10
+ --_po-arrow-b: unset;
11
+ --_po-arrow-l: unset;
12
+ --_po-arrow-r: unset;
13
+ --_po-arrow-t: unset;
14
+ --_po-arrow-ps: calc(var(--su6) * -1); // ps suffix used for placement, not positioning value
15
+ --_po-arrow-after-b: unset;
16
+ --_po-arrow-after-l: unset;
17
+ --_po-arrow-after-r: unset;
18
+ --_po-arrow-after-t: unset;
19
+ --_po-arrow-after-bs: unset;
20
+
21
+ // CONTEXTUAL STYLES
37
22
  .dark-mode({
38
- background-color: var(--black-075);
39
- border-color: var(--bc-light);
40
- box-shadow: var(--bs-lg);
23
+ --_po-bg: var(--black-075);
24
+ --_po-bc: var(--bc-light);
25
+ --_po-bs: var(--bs-lg);
26
+ --_po-arrow-fc: var(--black-075);
41
27
  });
42
-
43
- &.s-popover__tooltip {
44
- width: auto;
45
- min-width: unset;
46
- }
47
-
28
+
29
+ // MODIFIERS
48
30
  &.is-visible {
49
- display: block;
31
+ --_po-d: block;
50
32
  }
51
-
52
- &[data-popper-placement^="top"] > .s-popover--arrow,
53
- .s-popover--arrow__bc,
54
- .s-popover--arrow__bl,
55
- .s-popover--arrow__br {
56
- bottom: calc(var(--su6) * -1);
57
-
58
- &:after {
59
- bottom: 1px;
60
- box-shadow: 2px 2px 5px 0 hsla(0, 0, 0, 0.07), 2px 2px 2px -1px hsla(0, 0, 0, 0.1);
61
-
62
- .highcontrast-mode({
63
- box-shadow: 1px 1px 0 0 var(--bc-medium);
64
- });
65
- }
33
+ &&__tooltip {
34
+ --_po-wmn: unset;
35
+ --_po-w: auto;
66
36
  }
67
-
68
- &[data-popper-placement^="bottom"] > .s-popover--arrow,
69
- .s-popover--arrow__tc,
70
- .s-popover--arrow__tl,
71
- .s-popover--arrow__tr {
72
- top: calc(var(--su6) * -1);
73
-
74
- &:after {
75
- top: 1px;
76
- box-shadow: -1px -1px 1px 0 hsla(0, 0, 0, 0.12);
77
-
78
- .highcontrast-mode({
79
- box-shadow: -1px -1px 0 0 var(--bc-medium);
80
- });
81
- }
37
+
38
+ // CHILD ELEMENTS
39
+ // Arrow
40
+ &[data-popper-placement^="top"] > &--arrow,
41
+ & &--arrow__bc,
42
+ & &--arrow__bl,
43
+ & &--arrow__br {
44
+ --_po-arrow-b: var(--_po-arrow-ps);
45
+ --_po-arrow-after-b: var(--su-static1);
46
+ --_po-arrow-after-bs: 2px 2px 5px 0 hsla(0, 0%, 0%, 0.07), 2px 2px 2px -1px hsla(0, 0%, 0%, 0.1);
47
+ .highcontrast-mode({ --_po-arrow-after-bs: 1px 1px 0 0 var(--bc-medium); });
82
48
  }
83
-
84
- &[data-popper-placement^="left"] > .s-popover--arrow,
85
- .s-popover--arrow__rc,
86
- .s-popover--arrow__rt,
87
- .s-popover--arrow__rb {
88
- right: calc(var(--su6) * -1);
89
-
90
- &:after {
91
- right: 1px;
92
- box-shadow: 2px -2px 5px 0 hsla(0, 0, 0, 0.07), 2px -2px 2px -1px hsla(0, 0, 0, 0.1);
93
-
94
- .highcontrast-mode({
95
- box-shadow: 1px -1px 0 0 var(--bc-medium);
96
- });
97
- }
49
+ &[data-popper-placement^="bottom"] > &--arrow,
50
+ & &--arrow__tc,
51
+ & &--arrow__tl,
52
+ & &--arrow__tr {
53
+ --_po-arrow-t: var(--_po-arrow-ps);
54
+ --_po-arrow-after-t: var(--su-static1);
55
+ --_po-arrow-after-bs: -1px -1px 1px 0 hsla(0, 0%, 0%, 0.12);
56
+ .highcontrast-mode({ --_po-arrow-after-bs: -1px -1px 0 0 var(--bc-medium); });
98
57
  }
99
-
100
- &[data-popper-placement^="right"] > .s-popover--arrow,
101
- .s-popover--arrow__lc,
102
- .s-popover--arrow__lt,
103
- .s-popover--arrow__lb {
104
- left: calc(var(--su6) * -1);
105
-
106
- &:after {
107
- left: 1px;
108
- box-shadow: -2px 2px 5px 0 hsla(0, 0, 0, 0.07), -2px 2px 2px -1px hsla(0, 0, 0, 0.1);
109
-
110
- .highcontrast-mode({
111
- box-shadow: -1px 1px 0 0 var(--bc-medium);
112
- });
113
- }
58
+ &[data-popper-placement^="left"] > &--arrow,
59
+ & &--arrow__rc,
60
+ & &--arrow__rt,
61
+ & &--arrow__rb {
62
+ --_po-arrow-r: var(--_po-arrow-ps);
63
+ --_po-arrow-after-r: var(--su-static1);
64
+ --_po-arrow-after-bs: 2px -2px 5px 0 hsla(0, 0%, 0%, 0.07), 2px -2px 2px -1px hsla(0, 0%, 0%, 0.1);
65
+ .highcontrast-mode({ --_po-arrow-after-bs: 1px -1px 0 0 var(--bc-medium); });
114
66
  }
115
-
116
- .s-popover--arrow__tc,
117
- .s-popover--arrow__bc {
118
- left: calc(50% - var(--su6));
67
+ &[data-popper-placement^="right"] > &--arrow,
68
+ & &--arrow__lc,
69
+ & &--arrow__lt,
70
+ & &--arrow__lb {
71
+ --_po-arrow-l: var(--_po-arrow-ps);
72
+ --_po-arrow-after-l: var(--su-static1);
73
+ --_po-arrow-after-bs: -2px 2px 5px 0 hsla(0, 0%, 0%, 0.07), -2px 2px 2px -1px hsla(0, 0%, 0%, 0.1);
74
+ .highcontrast-mode({ --_po-arrow-after-bs: -1px 1px 0 0 var(--bc-medium); });
119
75
  }
120
-
121
- .s-popover--arrow__lc,
122
- .s-popover--arrow__rc {
123
- top: calc(50% - var(--su6));
76
+ & &--arrow__tc,
77
+ & &--arrow__bc {
78
+ --_po-arrow-l: calc(50% - var(--su6));
124
79
  }
125
-
126
- .s-popover--arrow__tr,
80
+ & &--arrow__lc,
81
+ & &--arrow__rc {
82
+ --_po-arrow-t: calc(50% - var(--su6));
83
+ }
84
+ & &--arrow__tr,
127
85
  .s-popover--arrow__br {
128
- right: var(--su12);
86
+ --_po-arrow-r: var(--su12);
129
87
  }
130
-
131
- .s-popover--arrow__rb,
132
- .s-popover--arrow__lb {
133
- bottom: var(--su12);
88
+ & &--arrow__rb,
89
+ & &--arrow__lb {
90
+ --_po-arrow-b: var(--su12);
134
91
  }
135
- }
136
-
137
- // ============================================================================
138
- // $ CLOSE BUTTON
139
- // ----------------------------------------------------------------------------
140
-
141
- .s-popover--close {
142
- float: right; // Use floats for title wrapping
143
- top: calc(var(--su8) * -1); // Compensate for s-popover's padding
144
- right: calc(var(--su8) * -1); // Compensate for s-popover's padding
145
- padding: var(--su8) !important;
146
- }
147
-
148
- // ============================================================================
149
- // $ ARROWS
150
- // ----------------------------------------------------------------------------
151
- //
152
- // TABLE OF CONTENTS
153
- // • BASE STYLE
154
- // • LOCATIONS
155
- // • TOP
156
- // • BOTTOM
157
- // • TOP & BOTTOM DIRECTIONS (Left, Center, Right)
158
- // • LEFT
159
- // • RIGHT
160
- // • LEFT & RIGHT DIRECTIONS (Top, Center, Bottom)
161
- //
162
- // ============================================================================
163
- // $ BASE STYLE
164
- // Sets the base arrow style for tooltips, popovers, and dropdowns.
165
- // ----------------------------------------------------------------------------
92
+ & &--arrow {
93
+ &,
94
+ &:before,
95
+ &:after {
96
+ display: block;
97
+ height: var(--su12);
98
+ position: absolute;
99
+ width: var(--su12);
100
+ z-index: -1;
101
+ }
102
+ &:before, // This renders our border
103
+ &:after {
104
+ content: '';
105
+ transform: rotate(45deg);
106
+ }
107
+ &:after { // This renders our foreground color
108
+ bottom: var(--_po-arrow-after-b);
109
+ box-shadow: var(--_po-arrow-after-bs);
110
+ left: var(--_po-arrow-after-l);
111
+ right: var(--_po-arrow-after-r);
112
+ top: var(--_po-arrow-after-t);
113
+
114
+ background: currentColor;
115
+ border-radius: calc(var(--su-static1) * 1.5);
116
+ }
166
117
 
167
- .s-popover--arrow,
168
- .s-popover--arrow:before,
169
- .s-popover--arrow:after {
118
+ bottom: var(--_po-arrow-b);
119
+ color: var(--_po-arrow-fc);
120
+ left: var(--_po-arrow-l);
121
+ right: var(--_po-arrow-r);
122
+ top: var(--_po-arrow-t);
123
+ }
124
+ // Close btn
125
+ & &--close {
126
+ float: right; // Use floats for title wrapping
127
+ top: calc(var(--su8) * -1); // Compensate for s-popover's padding
128
+ right: calc(var(--su8) * -1); // Compensate for s-popover's padding
129
+ padding: var(--su8) !important;
130
+ }
131
+
132
+ background-color: var(--_po-bg);
133
+ border: 1px solid var(--_po-bc);
134
+ box-shadow: var(--_po-bs);
135
+ display: var(--_po-d);
136
+ min-width: var(--_po-wmn);
137
+ width: var(--_po-w);
138
+
139
+ border-radius: var(--br-md);
140
+ color: var(--fc-dark);
141
+ font-size: var(--fs-body1);
142
+ max-width: 24rem;
143
+ padding: var(--su12);
170
144
  position: absolute;
171
- display: block;
172
- width: var(--su12);
173
- height: var(--su12);
174
- z-index: -1;
175
- }
176
-
177
- .s-popover--arrow {
178
- color: var(--white);
179
-
180
- .dark-mode({
181
- color: var(--black-075);
182
- });
183
- }
184
-
185
- .s-popover--arrow:before {
186
- // This renders our border
187
- content: '';
188
- transform: rotate(45deg);
189
- }
190
-
191
- .s-popover--arrow:after {
192
- // This renders our foreground color
193
- content: '';
194
- transform: rotate(45deg);
195
- border-radius: 1.5px;
196
- background: currentColor;
197
- }
145
+ white-space: normal; // Guard against popovers being in a container with white-space: nowrap. Without this, the content pops *out* of the popover.
146
+ z-index: var(--zi-popovers);
147
+ }
148
+
@@ -1,12 +1,3 @@
1
- //
2
- // STACK OVERFLOW
3
- // POST SUMMARY
4
- //
5
- // This CSS comes from Stacks, our CSS & Pattern library for rapidly building
6
- // Stack Overflow. For documentation of all these classes and how to contribute,
7
- // visit https://stackoverflow.design/
8
- //
9
-
10
1
  .s-post-summary {
11
2
  position: relative;
12
3
  display: flex;