@stackoverflow/stacks 0.76.0 → 1.0.1
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/LICENSE.MD +9 -9
- package/README.md +0 -0
- package/dist/controllers/index.d.ts +7 -7
- package/dist/controllers/s-expandable-control.d.ts +17 -17
- package/dist/controllers/s-modal.d.ts +97 -97
- package/dist/controllers/s-navigation-tablist.d.ts +36 -36
- package/dist/controllers/s-popover.d.ts +155 -155
- package/dist/controllers/s-table.d.ts +8 -8
- package/dist/controllers/s-tooltip.d.ts +82 -82
- package/dist/controllers/s-uploader.d.ts +48 -48
- package/dist/css/stacks.css +4354 -2560
- package/dist/css/stacks.min.css +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/js/stacks.js +1978 -1978
- package/dist/js/stacks.min.js +1 -1
- package/dist/stacks.d.ts +21 -21
- package/lib/css/atomic/{_stacks-borders.less → borders.less} +30 -30
- package/lib/css/atomic/{_stacks-colors.less → colors.less} +0 -0
- package/lib/css/atomic/{_stacks-flex.less → flex.less} +14 -13
- package/lib/css/atomic/{_stacks-grid.less → grid.less} +11 -11
- package/lib/css/atomic/{_stacks-misc.less → misc.less} +22 -22
- package/lib/css/atomic/spacing.less +332 -0
- package/lib/css/atomic/{_stacks-typography.less → typography.less} +29 -29
- package/lib/css/atomic/width-height.less +194 -0
- package/lib/css/base/{_stacks-body.less → body.less} +2 -2
- package/lib/css/base/{_stacks-configuration-static.less → configuration-static.less} +3 -1
- package/lib/css/base/{_stacks-icons.less → icons.less} +0 -0
- package/lib/css/base/{_stacks-internals.less → internals.less} +0 -0
- package/lib/css/base/{_stacks-reset-meyer.less → reset-meyer.less} +0 -0
- package/lib/css/base/{_stacks-reset-normalize.less → reset-normalize.less} +0 -0
- package/lib/css/base/{_stacks-reset.less → reset.less} +2 -2
- package/lib/css/components/{_stacks-activity-indicator.less → activity-indicator.less} +9 -9
- package/lib/css/components/{_stacks-avatars.less → avatars.less} +40 -40
- package/lib/css/components/{_stacks-badges.less → badges.less} +11 -11
- package/lib/css/components/{_stacks-banners.less → banners.less} +5 -5
- package/lib/css/components/{_stacks-blank-states.less → blank-states.less} +2 -2
- package/lib/css/components/{_stacks-breadcrumbs.less → breadcrumbs.less} +7 -7
- package/lib/css/components/{_stacks-button-groups.less → button-groups.less} +2 -2
- package/lib/css/components/{_stacks-buttons.less → buttons.less} +46 -39
- package/lib/css/components/{_stacks-cards.less → cards.less} +2 -2
- package/lib/css/components/{_stacks-code-blocks.less → code-blocks.less} +8 -8
- package/lib/css/components/{_stacks-collapsible.less → collapsible.less} +0 -0
- package/lib/css/components/{_stacks-inputs.less → inputs.less} +41 -41
- package/lib/css/components/{_stacks-link-previews.less → link-previews.less} +17 -17
- package/lib/css/components/{_stacks-links.less → links.less} +4 -4
- package/lib/css/components/{_stacks-menu.less → menu.less} +5 -5
- package/lib/css/components/{_stacks-modals.less → modals.less} +20 -20
- package/lib/css/components/{_stacks-navigation.less → navigation.less} +12 -12
- package/lib/css/components/{_stacks-notices.less → notices.less} +12 -12
- package/lib/css/components/{_stacks-page-titles.less → page-titles.less} +9 -9
- package/lib/css/components/{_stacks-pagination.less → pagination.less} +8 -8
- package/lib/css/components/{_stacks-popovers.less → popovers.less} +17 -17
- package/lib/css/components/{_stacks-post-summary.less → post-summary.less} +35 -35
- package/lib/css/components/{_stacks-progress-bars.less → progress-bars.less} +29 -30
- package/lib/css/components/{_stacks-prose.less → prose.less} +31 -31
- package/lib/css/components/{_stacks-spinner.less → spinner.less} +14 -14
- package/lib/css/components/{_stacks-tables.less → tables.less} +10 -10
- package/lib/css/components/{_stacks-tags.less → tags.less} +24 -24
- package/lib/css/components/{_stacks-toggle-switches.less → toggle-switches.less} +5 -5
- package/lib/css/components/{_stacks-topbar.less → topbar.less} +22 -20
- package/lib/css/components/{_stacks-uploader.less → uploader.less} +18 -18
- package/lib/css/components/{_stacks-user-cards.less → user-cards.less} +14 -14
- package/lib/css/components/{_stacks-widget-dynamic.less → widget-dynamic.less} +1 -1
- package/lib/css/components/{_stacks-widget-static.less → widget-static.less} +39 -38
- package/lib/css/exports/{_stacks-constants-colors.less → constants-colors.less} +9 -29
- package/lib/css/exports/constants-helpers.less +108 -0
- package/lib/css/exports/constants-type.less +153 -0
- package/lib/css/exports/{_stacks-exports.less → exports.less} +4 -4
- package/lib/css/exports/{_stacks-mixins.less → mixins.less} +18 -1
- package/lib/css/stacks-dynamic.less +12 -12
- package/lib/css/stacks-static.less +38 -38
- package/lib/css/stacks.less +13 -13
- package/package.json +9 -9
- package/lib/css/atomic/_stacks-spacing.less +0 -168
- package/lib/css/atomic/_stacks-width-height.less +0 -195
- package/lib/css/exports/_stacks-constants-helpers.less +0 -139
- package/lib/css/exports/_stacks-constants-type.less +0 -152
|
@@ -9,23 +9,22 @@
|
|
|
9
9
|
// This file contains almost all the CSS for the sidebar widget. The only exception
|
|
10
10
|
// is the "current color" highlight when the widget is used for navigation. That
|
|
11
11
|
// part is configurable and is in the dynamic part of Stacks as
|
|
12
|
-
//
|
|
12
|
+
// widget-dynamic.less.
|
|
13
13
|
|
|
14
|
+
.s-sidebarwidget {
|
|
15
|
+
--s-sidebarwidget-content-padding: calc(var(--su16) - var(--su1)); // subtract 1px for border
|
|
16
|
+
--s-sidebarwidget-content-inner-spacing: var(--su12); // the spacing between two adjacent simple items
|
|
17
|
+
--s-sidebarwidget-content-outer-spacing: var(--su16); // the spacing at the start/end of a group of simple items, as well as between a complex item and its separator line
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@s-sidebarwidget-outer-border-color: var(--bc-medium);
|
|
20
|
-
@s-sidebarwidget-content-separator-color: var(--bc-light);
|
|
21
|
-
@s-sidebarwidget-header-background-color: var(--black-025);
|
|
19
|
+
--s-sidebarwidget-outer-border-color: var(--bc-medium);
|
|
20
|
+
--s-sidebarwidget-content-separator-color: var(--bc-light);
|
|
21
|
+
--s-sidebarwidget-header-background-color: var(--black-025);
|
|
22
22
|
|
|
23
|
-
.s-sidebarwidget {
|
|
24
23
|
position: relative; // so that it's the positioning parent for the :after
|
|
25
|
-
border: 1px solid
|
|
26
|
-
border-radius:
|
|
24
|
+
border: 1px solid var(--s-sidebarwidget-outer-border-color);
|
|
25
|
+
border-radius: var(--br-sm);
|
|
27
26
|
box-shadow: var(--bs-sm);
|
|
28
|
-
font-size:
|
|
27
|
+
font-size: var(--fs-body1);
|
|
29
28
|
background-color: var(--white);
|
|
30
29
|
|
|
31
30
|
&:not(.s-anchors) a:not(.button):not(.s-btn):not(.post-tag):not(.s-sidebarwidget--action):not(.s-user-card--link) {
|
|
@@ -61,9 +60,10 @@
|
|
|
61
60
|
top: -1px;
|
|
62
61
|
right: -1px;
|
|
63
62
|
left: -1px;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
border-
|
|
63
|
+
// TODO: this makes no sense. revisit.
|
|
64
|
+
height: calc(2px + var(--br-sm)); // we need 2px border + 2px border radius to have the correct corner shape
|
|
65
|
+
border-top: 1px solid var(--s-sidebarwidget-outer-border-color);
|
|
66
|
+
border-radius: var(--br-sm);
|
|
67
67
|
pointer-events: none; // if the top item is clickable, then we don't want to prevent clicking the top 2 pixels
|
|
68
68
|
|
|
69
69
|
// In order to also perfectly recreate the inner corner shape, our pseudo-element needs
|
|
@@ -72,14 +72,14 @@
|
|
|
72
72
|
@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%))) or (-webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)) {
|
|
73
73
|
-webkit-clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
|
|
74
74
|
clip-path: polygon(0% 0%, 100% 0%, 100% 50%, 0% 50%);
|
|
75
|
-
border: 1px solid
|
|
75
|
+
border: 1px solid var(--s-sidebarwidget-outer-border-color);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
.s-sidebarwidget--header,
|
|
81
81
|
.s-sidebarwidget--content {
|
|
82
|
-
border-top: 1px solid
|
|
82
|
+
border-top: 1px solid var(--s-sidebarwidget-content-separator-color);
|
|
83
83
|
|
|
84
84
|
&:active {
|
|
85
85
|
outline: none;
|
|
@@ -88,23 +88,23 @@
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
.s-sidebarwidget--header {
|
|
91
|
-
padding:
|
|
92
|
-
background:
|
|
91
|
+
padding: var(--s-sidebarwidget-content-inner-spacing) var(--s-sidebarwidget-content-padding);
|
|
92
|
+
background: var(--s-sidebarwidget-header-background-color);
|
|
93
93
|
color: var(--black-600);
|
|
94
|
-
font-size:
|
|
94
|
+
font-size: var(--fs-body2);
|
|
95
95
|
font-weight: normal;
|
|
96
96
|
|
|
97
97
|
&:first-child {
|
|
98
|
-
border-top-left-radius:
|
|
99
|
-
border-top-right-radius:
|
|
98
|
+
border-top-left-radius: var(--br-sm);
|
|
99
|
+
border-top-right-radius: var(--br-sm);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
&.s-sidebarwidget__small-bold-text {
|
|
103
|
-
font-size:
|
|
103
|
+
font-size: var(--fs-caption);
|
|
104
104
|
font-weight: bold;
|
|
105
105
|
.-action {
|
|
106
106
|
font-weight: normal;
|
|
107
|
-
line-height: 1.3 *
|
|
107
|
+
line-height: calc(1.3 * var(--fs-caption)); // line-height should be the same as in the outside element, so the header and action baselines line up
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
content: '';
|
|
115
115
|
float: left;
|
|
116
116
|
margin-top: ~"calc(1.3em / 2 - 5px)"; // 1.3 is our standard line height
|
|
117
|
-
margin-right:
|
|
117
|
+
margin-right: var(--su12);
|
|
118
118
|
border: 5px solid transparent;
|
|
119
119
|
border-left-color: var(--bc-darker);
|
|
120
120
|
border-right-width: 0;
|
|
@@ -131,16 +131,16 @@
|
|
|
131
131
|
|
|
132
132
|
.s-sidebarwidget--action {
|
|
133
133
|
float: right;
|
|
134
|
-
margin: 0 0
|
|
134
|
+
margin: 0 0 var(--su4) var(--su8);
|
|
135
135
|
color: var(--blue);
|
|
136
|
-
font-size:
|
|
136
|
+
font-size: var(--fs-fine);
|
|
137
137
|
line-height: 1.3 * 15px; // line-height should be the same as in the outside element, so the header and action baselines line up
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
table.s-sidebarwidget--content.s-sidebarwidget__items {
|
|
141
|
-
padding: (
|
|
141
|
+
padding: calc(var(--s-sidebarwidget-content-outer-spacing) - var(--s-sidebarwidget-content-inner-spacing)) calc(var(--s-sidebarwidget-content-padding) - var(--s-sidebarwidget-content-inner-spacing));
|
|
142
142
|
border-collapse: separate;
|
|
143
|
-
border-spacing:
|
|
143
|
+
border-spacing: var(--s-sidebarwidget-content-inner-spacing);
|
|
144
144
|
|
|
145
145
|
tr.-item {
|
|
146
146
|
display: table-row;
|
|
@@ -161,12 +161,12 @@ table.s-sidebarwidget--content.s-sidebarwidget__items {
|
|
|
161
161
|
|
|
162
162
|
.s-sidebarwidget--content {
|
|
163
163
|
margin: 0;
|
|
164
|
-
padding:
|
|
164
|
+
padding: var(--s-sidebarwidget-content-outer-spacing) var(--s-sidebarwidget-content-padding);
|
|
165
165
|
|
|
166
166
|
&.s-sidebarwidget__items {
|
|
167
167
|
display: block;
|
|
168
168
|
// the items themselves provide part of the spacing, so the content padding needs to account for that
|
|
169
|
-
padding: (
|
|
169
|
+
padding: calc(var(--s-sidebarwidget-content-outer-spacing) - var(--s-sidebarwidget-content-inner-spacing)) var(--s-sidebarwidget-content-padding);
|
|
170
170
|
&.s-sidebarwidget__block-items .s-sidebarwidget--item {
|
|
171
171
|
.d-block;
|
|
172
172
|
}
|
|
@@ -174,7 +174,7 @@ table.s-sidebarwidget--content.s-sidebarwidget__items {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
.s-sidebarwidget--item {
|
|
177
|
-
margin:
|
|
177
|
+
margin: var(--s-sidebarwidget-content-inner-spacing) 0;
|
|
178
178
|
|
|
179
179
|
&,
|
|
180
180
|
& > :first-child {
|
|
@@ -188,12 +188,12 @@ table.s-sidebarwidget--content.s-sidebarwidget__items {
|
|
|
188
188
|
content: '';
|
|
189
189
|
position: absolute;
|
|
190
190
|
left: 0;
|
|
191
|
-
height:
|
|
192
|
-
margin-top:
|
|
193
|
-
margin-left:
|
|
191
|
+
height: calc(100% + var(--s-sidebarwidget-content-inner-spacing));
|
|
192
|
+
margin-top: calc(var(--s-sidebarwidget-content-inner-spacing) / 2 * -1);
|
|
193
|
+
margin-left: calc(var(--s-sidebarwidget-content-padding) * -1 - 1px); // the orange selection indicator overlaps with the widget border
|
|
194
194
|
border-left-width: 3px;
|
|
195
195
|
border-left-style: solid;
|
|
196
|
-
// border-left-color is set in
|
|
196
|
+
// border-left-color is set in widget-dynamic.less
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
a,
|
|
@@ -203,10 +203,11 @@ table.s-sidebarwidget--content.s-sidebarwidget__items {
|
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
+
|
|
206
207
|
.s-sidebarwidget--subnav {
|
|
207
208
|
list-style-type: none;
|
|
208
209
|
padding-left: 0;
|
|
209
|
-
margin-left:
|
|
210
|
+
margin-left: var(--su8);
|
|
210
211
|
|
|
211
212
|
li {
|
|
212
213
|
margin-top: 12px;
|
|
@@ -219,7 +220,7 @@ table.s-sidebarwidget--content.s-sidebarwidget__items {
|
|
|
219
220
|
|
|
220
221
|
&[aria-current="true"],
|
|
221
222
|
&[aria-current="page"] {
|
|
222
|
-
// this is given a bullet-arrow in the primary color in
|
|
223
|
+
// this is given a bullet-arrow in the primary color in widget-dynamic.less
|
|
223
224
|
color: var(--black);
|
|
224
225
|
font-weight: bold;
|
|
225
226
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
@import (reference) "./
|
|
1
|
+
@import (reference) "./mixins.less";
|
|
2
2
|
|
|
3
3
|
//
|
|
4
4
|
// STACK OVERFLOW
|
|
@@ -145,13 +145,6 @@
|
|
|
145
145
|
@bronze-lighter: hsl(@bronze-h, 40%, 92%);
|
|
146
146
|
@bronze-darker: hsl(@bronze-h, 31%, 52%);
|
|
147
147
|
|
|
148
|
-
// $ SHADOWS
|
|
149
|
-
// ----------------------------------------------------------------------------
|
|
150
|
-
@bs-sm: 0 1px 2px hsla(0, 0%, 0%, 0.05), 0 1px 4px hsla(0, 0%, 0%, 0.05), 0 2px 8px hsla(0, 0%, 0%, 0.05);
|
|
151
|
-
@bs-md: 0 1px 3px hsla(0, 0%, 0%, 0.06), 0 2px 6px hsla(0, 0%, 0%, 0.06), 0 3px 8px hsla(0, 0%, 0%, 0.09);
|
|
152
|
-
@bs-lg: 0 1px 4px hsla(0, 0%, 0%, 0.09), 0 3px 8px hsla(0, 0%, 0%, 0.09), 0 4px 13px hsla(0, 0%, 0%, 0.13);
|
|
153
|
-
@bs-xl: 0 10px 24px hsla(0, 0%, 0%, 0.05), 0 20px 48px hsla(0, 0%, 0%, 0.05), 0 1px 4px hsla(0, 0%, 0%, 0.1);
|
|
154
|
-
|
|
155
148
|
// $ SCROLLBARS
|
|
156
149
|
// ----------------------------------------------------------------------------
|
|
157
150
|
@scrollbar: hsla(0, 0%, 0%, 0.2);
|
|
@@ -248,7 +241,7 @@
|
|
|
248
241
|
--theme-tag-hover-border-color: transparent;
|
|
249
242
|
|
|
250
243
|
// Topbar
|
|
251
|
-
--theme-topbar-height:
|
|
244
|
+
--theme-topbar-height: var(--su-static48);
|
|
252
245
|
--theme-topbar-background-color: var(--black-025);
|
|
253
246
|
|
|
254
247
|
// Topbar Search input
|
|
@@ -257,7 +250,7 @@
|
|
|
257
250
|
--theme-topbar-search-placeholder: var(--black-200);
|
|
258
251
|
--theme-topbar-search-border: var(--black-200);
|
|
259
252
|
--theme-topbar-search-border-focus: var(--blue-300);
|
|
260
|
-
--theme-topbar-search-shadow-focus: 0 0 0
|
|
253
|
+
--theme-topbar-search-shadow-focus: 0 0 0 var(--su-static4) var(--focus-ring);
|
|
261
254
|
|
|
262
255
|
// Topbar Search switcher
|
|
263
256
|
--theme-topbar-select-color: var(--black-700);
|
|
@@ -417,10 +410,10 @@
|
|
|
417
410
|
--focus-ring-muted: hsla(@black-h, @black-s, 15%, 10%);
|
|
418
411
|
|
|
419
412
|
// Shadows
|
|
420
|
-
--bs-sm:
|
|
421
|
-
--bs-md:
|
|
422
|
-
--bs-lg:
|
|
423
|
-
--bs-xl:
|
|
413
|
+
--bs-sm: 0 1px 2px hsla(0, 0%, 0%, 0.05), 0 1px 4px hsla(0, 0%, 0%, 0.05), 0 2px 8px hsla(0, 0%, 0%, 0.05);
|
|
414
|
+
--bs-md: 0 1px 3px hsla(0, 0%, 0%, 0.06), 0 2px 6px hsla(0, 0%, 0%, 0.06), 0 3px 8px hsla(0, 0%, 0%, 0.09);
|
|
415
|
+
--bs-lg: 0 1px 4px hsla(0, 0%, 0%, 0.09), 0 3px 8px hsla(0, 0%, 0%, 0.09), 0 4px 13px hsla(0, 0%, 0%, 0.13);
|
|
416
|
+
--bs-xl: 0 10px 24px hsla(0, 0%, 0%, 0.05), 0 20px 48px hsla(0, 0%, 0%, 0.05), 0 1px 4px hsla(0, 0%, 0%, 0.1);
|
|
424
417
|
|
|
425
418
|
// Scrollbars
|
|
426
419
|
--scrollbar: hsla(0, 0, 0, 0.2);
|
|
@@ -481,9 +474,6 @@
|
|
|
481
474
|
|
|
482
475
|
// Fades
|
|
483
476
|
--focus-ring: .native-fade(theme-secondary-color, 15)[];
|
|
484
|
-
|
|
485
|
-
// TODO
|
|
486
|
-
--theme-body-font-color: var(--black-800);
|
|
487
477
|
}
|
|
488
478
|
|
|
489
479
|
// -- Dark mode
|
|
@@ -680,9 +670,6 @@
|
|
|
680
670
|
|
|
681
671
|
// Fades
|
|
682
672
|
--focus-ring: .native-fade(theme-secondary-color, 25)[];
|
|
683
|
-
|
|
684
|
-
// TODO
|
|
685
|
-
--theme-body-font-color: var(--black-800);
|
|
686
673
|
}
|
|
687
674
|
|
|
688
675
|
// rules shared between .theme-dark and .theme-system w/ prefers-color-scheme: dark
|
|
@@ -691,12 +678,10 @@
|
|
|
691
678
|
|
|
692
679
|
&,
|
|
693
680
|
& .themed {
|
|
681
|
+
color: var(--theme-body-font-color);
|
|
694
682
|
.generate-themed-variables(theme-dark);
|
|
695
683
|
// add in the themed "native mixins", making sure to scope to the child .themed elements so they don't use the parent's values
|
|
696
684
|
.dark-themed-colors();
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
& .themed {
|
|
700
685
|
&:extend(.component-colors);
|
|
701
686
|
}
|
|
702
687
|
}
|
|
@@ -1060,9 +1045,6 @@
|
|
|
1060
1045
|
}
|
|
1061
1046
|
|
|
1062
1047
|
// place component-colors on the body directly (instead of :root) so consumers can use the --theme-* variables
|
|
1063
|
-
body {
|
|
1064
|
-
&:extend(.component-colors);
|
|
1065
|
-
}
|
|
1066
1048
|
|
|
1067
1049
|
// Light mode
|
|
1068
1050
|
body:not(.theme-dark),
|
|
@@ -1072,12 +1054,10 @@ body.theme-system .theme-light__forced {
|
|
|
1072
1054
|
|
|
1073
1055
|
&,
|
|
1074
1056
|
& .themed {
|
|
1057
|
+
color: var(--theme-body-font-color);
|
|
1075
1058
|
.generate-themed-variables(theme-light);
|
|
1076
1059
|
// add in the themed "native mixins", making sure to scope to the child .themed elements so they don't use the parent's values
|
|
1077
1060
|
.light-themed-colors();
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
& .themed {
|
|
1081
1061
|
&:extend(.component-colors);
|
|
1082
1062
|
}
|
|
1083
1063
|
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
//
|
|
2
|
+
// STACK OVERFLOW
|
|
3
|
+
// CONSTANTS -- HELPERS
|
|
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
|
+
// These are helper variables to quickly set values.
|
|
10
|
+
// These SHOULD NOT be reset.
|
|
11
|
+
//
|
|
12
|
+
// Table of Contents
|
|
13
|
+
// • z-index (zi-)
|
|
14
|
+
// • border-radius (br-)
|
|
15
|
+
// • box-shadow (bs-)
|
|
16
|
+
// • transition easings (te-)
|
|
17
|
+
//
|
|
18
|
+
body {
|
|
19
|
+
// Z-Index
|
|
20
|
+
--zi-hide: -1; // Hide something all the elements
|
|
21
|
+
--zi-base: 0; // Reset to 0
|
|
22
|
+
--zi-selected: 25; // Pop above siblings
|
|
23
|
+
--zi-active: 30; // Pop above selected siblings
|
|
24
|
+
--zi-dropdown: 1000; // Dropdowns
|
|
25
|
+
--zi-popovers: 2000; // Popovers, Popups, Autocompletes
|
|
26
|
+
--zi-tooltips: 3000; // Tooltips
|
|
27
|
+
--zi-banners: 4000; // Banners
|
|
28
|
+
--zi-navigation: 5000; // Navigation Bars
|
|
29
|
+
--zi-navigation-fixed: 5050; // Fixed navigation bars
|
|
30
|
+
--zi-modals-background: 8050; // Modals background
|
|
31
|
+
--zi-modals: 9000; // Modals
|
|
32
|
+
|
|
33
|
+
// Border Radius
|
|
34
|
+
--br-sm: 3px;
|
|
35
|
+
--br-md: 5px;
|
|
36
|
+
--br-lg: 7px;
|
|
37
|
+
--br-circle: 50%;
|
|
38
|
+
|
|
39
|
+
// Transition easings
|
|
40
|
+
--te-smooth-slow: cubic-bezier(0.25, 0.46, 0.45, 0.94); // easeOutQuad
|
|
41
|
+
--te-smooth: cubic-bezier(0.165, 0.84, 0.44, 1); // easeOutQuart
|
|
42
|
+
--te-smooth-quick: cubic-bezier(0.19, 1, 0.22, 1); // easeOutExpo
|
|
43
|
+
--te-back-out: cubic-bezier(0.175, 0.885, 0.32, 1.275); // easeOutBack
|
|
44
|
+
--te-back-in-out: cubic-bezier(0.68, -0.55, 0.265, 1.55); // easeInOutBack
|
|
45
|
+
--te-ease-in: cubic-bezier(0.47, 0, 0.745, 0.715); // easeIn
|
|
46
|
+
--te-ease-in-out: cubic-bezier(0.445, 0.05, 0.55, 0.95); // easeInOut
|
|
47
|
+
--te-ease-out: cubic-bezier(0.39, 0.575, 0.565, 1); // easeOut
|
|
48
|
+
|
|
49
|
+
--default-transition-duration: 0.1s;
|
|
50
|
+
--transition-time: var(--default-transition-duration);
|
|
51
|
+
|
|
52
|
+
// Sizing
|
|
53
|
+
--s-full: 97.2307692rem; // Based on a pixel size of 1264px;
|
|
54
|
+
--s-step: calc(var(--s-full) / 12);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// ============================================================================
|
|
58
|
+
// $ RESPONSIVE BREAKPOINTS
|
|
59
|
+
// ----------------------------------------------------------------------------
|
|
60
|
+
@breakpoint-lg: 1264px;
|
|
61
|
+
@breakpoint-md: 980px;
|
|
62
|
+
@breakpoint-sm: 640px;
|
|
63
|
+
|
|
64
|
+
// ============================================================================
|
|
65
|
+
// $ SCROLLBAR STYLING
|
|
66
|
+
// ----------------------------------------------------------------------------
|
|
67
|
+
@scrollbar-styles: {
|
|
68
|
+
&::-webkit-scrollbar {
|
|
69
|
+
width: calc(var(--su-static12) - var(--su-static2));
|
|
70
|
+
height: calc(var(--su-static12) - var(--su-static2));
|
|
71
|
+
background-color: transparent;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
&::-webkit-scrollbar-track {
|
|
75
|
+
border-radius: calc(var(--su-static12) - var(--su-static2));
|
|
76
|
+
background-color: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&::-webkit-scrollbar-thumb {
|
|
80
|
+
border-radius: calc(var(--su-static12) - var(--su-static2));
|
|
81
|
+
background-color: var(--scrollbar);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&::-webkit-scrollbar-corner {
|
|
85
|
+
background-color: transparent;
|
|
86
|
+
border-color: transparent;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
scrollbar-color: var(--scrollbar) transparent;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ============================================================================
|
|
93
|
+
// $ FOCUS STYLING
|
|
94
|
+
// ----------------------------------------------------------------------------
|
|
95
|
+
@focus-styles: {
|
|
96
|
+
// Hide focus styles if they're not needed, for example,
|
|
97
|
+
// when an element receives focus via the mouse.
|
|
98
|
+
&:focus:not(:focus-visible) {
|
|
99
|
+
outline: none;
|
|
100
|
+
box-shadow: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Show focus styles on keyboard focus.
|
|
104
|
+
&:focus-visible {
|
|
105
|
+
outline: none;
|
|
106
|
+
box-shadow: 0 0 0 var(--su-static4) var(--focus-ring-muted);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
//
|
|
2
|
+
// STACK OVERFLOW
|
|
3
|
+
// CONSTANTS -- TYPOGRAPHY
|
|
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
|
+
// These are the Stacks type variables. These should be used in place of
|
|
10
|
+
// hard-coded values within CSS declarations.
|
|
11
|
+
//
|
|
12
|
+
//
|
|
13
|
+
// ============================================================================
|
|
14
|
+
// $ FONT FAMILY (ff-)
|
|
15
|
+
// ----------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
// Add Segoe UI Adjusted as a font family, and adjust its baseline
|
|
18
|
+
@font-face {
|
|
19
|
+
font-family: "Segoe UI Adjusted";
|
|
20
|
+
src: local(Segoe UI);
|
|
21
|
+
ascent-override: 95%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Segoe UI is variable, but only in Windows 11, so add all the variants
|
|
25
|
+
@font-face {
|
|
26
|
+
font-family: "Segoe UI Adjusted";
|
|
27
|
+
src: local(Segoe UI Italic);
|
|
28
|
+
ascent-override: 95%;
|
|
29
|
+
font-style: italic;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@font-face {
|
|
33
|
+
font-family: "Segoe UI Adjusted";
|
|
34
|
+
src: local(Segoe UI Semibold);
|
|
35
|
+
ascent-override: 95%;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@font-face {
|
|
40
|
+
font-family: "Segoe UI Adjusted";
|
|
41
|
+
src: local(Segoe UI Semibold Italic);
|
|
42
|
+
ascent-override: 95%;
|
|
43
|
+
font-style: italic;
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@font-face {
|
|
48
|
+
font-family: "Segoe UI Adjusted";
|
|
49
|
+
src: local(Segoe UI Bold);
|
|
50
|
+
ascent-override: 90%;
|
|
51
|
+
font-weight: 700;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@font-face {
|
|
55
|
+
font-family: "Segoe UI Adjusted";
|
|
56
|
+
src: local(Segoe UI Bold Italic);
|
|
57
|
+
ascent-override: 95%;
|
|
58
|
+
font-style: italic;
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@font-face {
|
|
63
|
+
font-family: "Segoe UI Adjusted";
|
|
64
|
+
src: local(Segoe UI Black);
|
|
65
|
+
ascent-override: 95%;
|
|
66
|
+
font-weight: 800;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@font-face {
|
|
70
|
+
font-family: "Segoe UI Adjusted";
|
|
71
|
+
src: local(Segoe UI Black Italic);
|
|
72
|
+
ascent-override: 95%;
|
|
73
|
+
font-style: italic;
|
|
74
|
+
font-weight: 800;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// TODO remove font-family Less variables. Keeping them here for now for comments.
|
|
78
|
+
@ff-sans:
|
|
79
|
+
-apple-system, BlinkMacSystemFont, // San Francisco on macOS and iOS
|
|
80
|
+
"Segoe UI Adjusted", "Segoe UI", // Windows
|
|
81
|
+
"Liberation Sans", // Linux
|
|
82
|
+
sans-serif; // The final fallback for rendering in sans-serif.
|
|
83
|
+
@ff-serif: Georgia, Cambria, "Times New Roman", Times, serif;
|
|
84
|
+
@ff-mono:
|
|
85
|
+
ui-monospace, // San Francisco Mono on macOS and iOS
|
|
86
|
+
"Cascadia Mono", "Segoe UI Mono", // Newer Windows monospace fonts that are optionally installed. Most likely to be rendered in Consolas
|
|
87
|
+
"Liberation Mono", // Linux
|
|
88
|
+
Menlo, Monaco, Consolas, // A few sensible system font choices
|
|
89
|
+
monospace; // The final fallback for rendering in monospace.
|
|
90
|
+
|
|
91
|
+
html,
|
|
92
|
+
body {
|
|
93
|
+
--ff-sans: @ff-sans;
|
|
94
|
+
--ff-serif: @ff-serif;
|
|
95
|
+
--ff-mono: @ff-mono;
|
|
96
|
+
--theme-body-font-family: var(--ff-sans);
|
|
97
|
+
|
|
98
|
+
// ============================================================================
|
|
99
|
+
// $ FONT SIZES (fs-)
|
|
100
|
+
// Base font-size is 13px.
|
|
101
|
+
// ----------------------------------------------------------------------------
|
|
102
|
+
--fs-fine: 11px;
|
|
103
|
+
--fs-caption: 12px;
|
|
104
|
+
--fs-body1: 13px;
|
|
105
|
+
|
|
106
|
+
// Relative to the root element
|
|
107
|
+
--fs-body2: 1.153846154rem;
|
|
108
|
+
--fs-body3: 1.307692308rem;
|
|
109
|
+
--fs-subheading: 1.461538462rem;
|
|
110
|
+
--fs-title: 1.615384615rem;
|
|
111
|
+
--fs-headline1: 2.076923077rem;
|
|
112
|
+
--fs-headline2: 2.615384615rem;
|
|
113
|
+
--fs-display1: 3.307692308rem;
|
|
114
|
+
--fs-display2: 4.230769231rem;
|
|
115
|
+
--fs-display3: 5.307692308rem;
|
|
116
|
+
--fs-display4: 7.615384615rem;
|
|
117
|
+
|
|
118
|
+
// Relative to the parent
|
|
119
|
+
--fs-body2-relative: 1.153846154em;
|
|
120
|
+
--fs-body3-relative: 1.307692308em;
|
|
121
|
+
--fs-subheading-relative: 1.461538462em;
|
|
122
|
+
--fs-title-relative: 1.615384615em;
|
|
123
|
+
--fs-headline1-relative: 2.076923077em;
|
|
124
|
+
--fs-headline2-relative: 2.615384615em;
|
|
125
|
+
--fs-display1-relative: 3.307692308em;
|
|
126
|
+
--fs-display2-relative: 4.230769231em;
|
|
127
|
+
--fs-display3-relative: 5.307692308em;
|
|
128
|
+
--fs-display4-relative: 7.615384615em;
|
|
129
|
+
|
|
130
|
+
--fs-base: 13px;
|
|
131
|
+
|
|
132
|
+
// ============================================================================
|
|
133
|
+
// $ LINE HEIGHT (lh-)
|
|
134
|
+
// ----------------------------------------------------------------------------
|
|
135
|
+
// Need to remove the unit off the font-size to make line-height unitless
|
|
136
|
+
// FIXME this shouldn't be public. Find a way to use unitless `--fs-base`.
|
|
137
|
+
--stacks-internals-lh-unit: 13;
|
|
138
|
+
|
|
139
|
+
// Now the various line-height variables
|
|
140
|
+
--lh-xs: 1;
|
|
141
|
+
--lh-sm: calc((var(--stacks-internals-lh-unit) + 2) / var(--stacks-internals-lh-unit));
|
|
142
|
+
--lh-md: calc((var(--stacks-internals-lh-unit) + 4) / var(--stacks-internals-lh-unit));
|
|
143
|
+
--lh-lg: calc((var(--stacks-internals-lh-unit) + 8) / var(--stacks-internals-lh-unit));
|
|
144
|
+
--lh-xl: calc((var(--stacks-internals-lh-unit) + 12) / var(--stacks-internals-lh-unit));
|
|
145
|
+
--lh-xxl: 2;
|
|
146
|
+
|
|
147
|
+
--lh-base: var(--lh-md);
|
|
148
|
+
|
|
149
|
+
// Holdover line-heights from production. These are NOT to be used and
|
|
150
|
+
// need to be deprecated.
|
|
151
|
+
// ----------------------------------------------------------------------------
|
|
152
|
+
--lh-6: ((var(--stacks-internals-lh-unit) + 6) / var(--stacks-internals-lh-unit));
|
|
153
|
+
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// Wherein we establish a bunch of values to make our lives a lot easier.
|
|
10
10
|
//
|
|
11
11
|
// ============================================================================
|
|
12
|
-
@import "
|
|
13
|
-
@import "
|
|
14
|
-
@import "
|
|
15
|
-
@import "
|
|
12
|
+
@import "constants-type.less"; // Type styles, sizes, and line-heights
|
|
13
|
+
@import "constants-helpers.less"; // Border radius, z-index, spacing, transitions, etc
|
|
14
|
+
@import "constants-colors.less"; // Colors
|
|
15
|
+
@import "mixins.less";
|
|
@@ -19,6 +19,22 @@
|
|
|
19
19
|
&:after { clear: both; }
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// -- LIGHTMODE
|
|
24
|
+
// .light-mode-forced ensures light color scheme is used in .theme-light__forced
|
|
25
|
+
//
|
|
26
|
+
// .light-mode-forced({ color: var(--black-900) });
|
|
27
|
+
//
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
|
|
30
|
+
.light-mode-forced(@rules) {
|
|
31
|
+
.theme-light__forced &,
|
|
32
|
+
body.theme-system .theme-light__forced &,
|
|
33
|
+
body.theme-dark .theme-light__forced & {
|
|
34
|
+
@rules();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
22
38
|
// ===========================================================================
|
|
23
39
|
// -- DARKMODE
|
|
24
40
|
// .darkmode renders a dark mode override behind the
|
|
@@ -39,7 +55,8 @@
|
|
|
39
55
|
}
|
|
40
56
|
|
|
41
57
|
body.theme-dark &,
|
|
42
|
-
.theme-dark__forced
|
|
58
|
+
.theme-dark__forced &,
|
|
59
|
+
body.theme-system .theme-dark__forced & {
|
|
43
60
|
@rules();
|
|
44
61
|
}
|
|
45
62
|
}
|
|
@@ -15,21 +15,21 @@
|
|
|
15
15
|
// via variables.
|
|
16
16
|
// ----------------------------------------------------------------------------
|
|
17
17
|
// -- SET BASIC STYLES FOR BODY
|
|
18
|
-
@import "base/
|
|
18
|
+
@import "base/body.less";
|
|
19
19
|
|
|
20
20
|
// -- COMPONENTS
|
|
21
|
-
@import "components/
|
|
22
|
-
@import "components/
|
|
23
|
-
@import "components/
|
|
24
|
-
@import "components/
|
|
25
|
-
@import "components/
|
|
26
|
-
@import "components/
|
|
27
|
-
@import "components/
|
|
28
|
-
@import "components/
|
|
21
|
+
@import "components/banners.less";
|
|
22
|
+
@import "components/buttons.less";
|
|
23
|
+
@import "components/links.less";
|
|
24
|
+
@import "components/link-previews.less";
|
|
25
|
+
@import "components/notices.less";
|
|
26
|
+
@import "components/tags.less";
|
|
27
|
+
@import "components/pagination.less";
|
|
28
|
+
@import "components/widget-dynamic.less";
|
|
29
29
|
|
|
30
30
|
// -- LESS CONSTANTS AND MIXINS
|
|
31
|
-
@import "exports/
|
|
31
|
+
@import "exports/exports.less";
|
|
32
32
|
|
|
33
33
|
// -- CONFIG
|
|
34
|
-
@import "base/
|
|
35
|
-
@import "base/
|
|
34
|
+
@import "base/configuration-static.less";
|
|
35
|
+
@import "base/internals.less";
|