@stackoverflow/stacks 1.3.6 → 1.4.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.
@@ -7,14 +7,14 @@
7
7
  // visit https://stackoverflow.design/
8
8
  //
9
9
  .construct-notice-component() {
10
- background: var(--_bg, var(--black-050));
11
- border-color: var(--_bc, var(--bc-medium));
10
+ background: var(--_no-bg, var(--black-050));
11
+ border-color: var(--_no-bc, var(--bc-medium));
12
12
  border-style: solid;
13
- color: var(--_fc, var(--fc-medium));
13
+ color: var(--_no-fc, var(--fc-medium));
14
14
  font-size: var(--fs-body1);
15
15
 
16
16
  code {
17
- background: var(--_code-bg, transparent);
17
+ background: var(--_no-code-bg, transparent);
18
18
  }
19
19
 
20
20
  & &--btn {
@@ -23,142 +23,142 @@
23
23
 
24
24
  &:focus,
25
25
  &:hover {
26
- background: var(--_btn-focus-bg, var(--black-100));
26
+ background: var(--_no-btn-focus-bg, var(--black-100));
27
27
  }
28
28
 
29
29
  &:active {
30
- background: var(--_btn-active-bg, var(--black-150));
30
+ background: var(--_no-btn-active-bg, var(--black-150));
31
31
  }
32
32
  }
33
33
 
34
34
  &:not(&__important) {
35
- .dark-mode({ --_bc: var(--_bg); });
36
- .highcontrast-mode({ --_bc: currentColor; });
37
- .highcontrast-dark-mode({ --_bc: currentColor; });
35
+ .dark-mode({ --_no-bc: var(--_no-bg); });
36
+ .highcontrast-mode({ --_no-bc: currentColor; });
37
+ .highcontrast-dark-mode({ --_no-bc: currentColor; });
38
38
  }
39
39
 
40
40
  &__important {
41
- --_bc: var(--_bg);
42
- --_bg: var(--black-700);
43
- --_fc: var(--white);
44
- --_btn-focus-bg: var(--black-800);
45
- --_btn-active-bg: var(--black-900);
41
+ --_no-bc: var(--_no-bg);
42
+ --_no-bg: var(--black-700);
43
+ --_no-fc: var(--white);
44
+ --_no-btn-focus-bg: var(--black-800);
45
+ --_no-btn-active-bg: var(--black-900);
46
46
 
47
- .highcontrast-mode({ --_bc: var(--_bg); });
47
+ .highcontrast-mode({ --_no-bc: var(--_no-bg); });
48
48
  }
49
49
 
50
50
  &__danger {
51
- --_bc: var(--red-200);
52
- --_bg: var(--red-050);
53
- --_btn-focus-bg: var(--red-100);
54
- --_btn-active-bg: var(--red-200);
51
+ --_no-bc: var(--red-200);
52
+ --_no-bg: var(--red-050);
53
+ --_no-btn-focus-bg: var(--red-100);
54
+ --_no-btn-active-bg: var(--red-200);
55
55
  }
56
56
  &__danger:not(&__important) {
57
57
  .highcontrast-mode({
58
- --_bg: var(--red-200);
58
+ --_no-bg: var(--red-200);
59
59
  });
60
60
  }
61
61
  &__danger&__important {
62
- --_bc: var(--_bg);
63
- --_bg: var(--red-500);
64
- --_btn-focus-bg: var(--red-600);
65
- --_btn-active-bg: var(--red-700);
62
+ --_no-bc: var(--_no-bg);
63
+ --_no-bg: var(--red-500);
64
+ --_no-btn-focus-bg: var(--red-600);
65
+ --_no-btn-active-bg: var(--red-700);
66
66
 
67
67
  .dark-mode({
68
- --_bg: var(--red-400);
69
- --_fc: var(--black-900);
68
+ --_no-bg: var(--red-400);
69
+ --_no-fc: var(--black-900);
70
70
  });
71
71
  .highcontrast-dark-mode({
72
- --_bg: var(--red-500);
73
- --_fc: var(--white);
72
+ --_no-bg: var(--red-500);
73
+ --_no-fc: var(--white);
74
74
  });
75
75
  }
76
76
 
77
77
  &__info {
78
- --_bc: var(--theme-secondary-150);
79
- --_bg: var(--theme-secondary-050);
80
- --_btn-focus-bg: var(--theme-secondary-100);
81
- --_btn-active-bg: var(--theme-secondary-150);
82
- --_code-bg: var(--theme-secondary-150);
78
+ --_no-bc: var(--theme-secondary-150);
79
+ --_no-bg: var(--theme-secondary-050);
80
+ --_no-btn-focus-bg: var(--theme-secondary-100);
81
+ --_no-btn-active-bg: var(--theme-secondary-150);
82
+ --_no-code-bg: var(--theme-secondary-150);
83
83
  }
84
84
  &__info:not(&__important) {
85
85
  .highcontrast-mode({
86
- --_bg: var(--theme-secondary-100);
86
+ --_no-bg: var(--theme-secondary-100);
87
87
  });
88
88
  .highcontrast-dark-mode({
89
- --_bg: var(--theme-secondary-100);
89
+ --_no-bg: var(--theme-secondary-100);
90
90
  });
91
91
  }
92
92
  &__info&__important {
93
- --_bc: var(--_bg);
94
- --_bg: var(--theme-secondary-400);
95
- --_btn-focus-bg: var(--theme-secondary-500);
96
- --_btn-active-bg: var(--theme-secondary-600);
93
+ --_no-bc: var(--_no-bg);
94
+ --_no-bg: var(--theme-secondary-400);
95
+ --_no-btn-focus-bg: var(--theme-secondary-500);
96
+ --_no-btn-active-bg: var(--theme-secondary-600);
97
97
 
98
98
  .dark-mode({
99
- --_bg: var(--theme-secondary-300);
100
- --_fc: var(--black-900);
99
+ --_no-bg: var(--theme-secondary-300);
100
+ --_no-fc: var(--black-900);
101
101
  });
102
102
  .highcontrast-dark-mode({
103
- --_bg: var(--theme-secondary-400);
104
- --_fc: var(--white);
103
+ --_no-bg: var(--theme-secondary-400);
104
+ --_no-fc: var(--white);
105
105
  });
106
106
  }
107
107
 
108
108
  &__success {
109
- --_bc: var(--green-200);
110
- --_bg: var(--green-050);
111
- --_btn-focus-bg: var(--green-100);
112
- --_btn-active-bg: var(--green-200);
109
+ --_no-bc: var(--green-200);
110
+ --_no-bg: var(--green-050);
111
+ --_no-btn-focus-bg: var(--green-100);
112
+ --_no-btn-active-bg: var(--green-200);
113
113
  }
114
114
  &__success:not(&__important) {
115
115
  .highcontrast-mode({
116
- --_bg: var(--green-200);
116
+ --_no-bg: var(--green-200);
117
117
  });
118
118
  }
119
119
  &__success&__important {
120
- --_bc: var(--_bg);
121
- --_bg: var(--green-400);
122
- --_fc: var(--black-900);
123
- --_btn-focus-bg: var(--green-500);
124
- --_btn-active-bg: var(--green-600);
120
+ --_no-bc: var(--_no-bg);
121
+ --_no-bg: var(--green-400);
122
+ --_no-fc: var(--black-900);
123
+ --_no-btn-focus-bg: var(--green-500);
124
+ --_no-btn-active-bg: var(--green-600);
125
125
 
126
126
  .dark-mode({
127
- --_bg: var(--green-500);
128
- --_fc: var(--white);
127
+ --_no-bg: var(--green-500);
128
+ --_no-fc: var(--white);
129
129
  });
130
130
  .highcontrast-mode({
131
- --_bg: var(--green-500);
132
- --_fc: var(--white);
131
+ --_no-bg: var(--green-500);
132
+ --_no-fc: var(--white);
133
133
  });
134
134
  }
135
135
 
136
136
  &__warning {
137
- --_bc: var(--yellow-300);
138
- --_bg: var(--yellow-050);
139
- --_btn-focus-bg: var(--yellow-200);
140
- --_btn-active-bg: var(--yellow-300);
141
- --_code-bg: var(--yellow-200);
137
+ --_no-bc: var(--yellow-300);
138
+ --_no-bg: var(--yellow-050);
139
+ --_no-btn-focus-bg: var(--yellow-200);
140
+ --_no-btn-active-bg: var(--yellow-300);
141
+ --_no-code-bg: var(--yellow-200);
142
142
  }
143
143
  &__warning:not(&__important) {
144
144
  .highcontrast-mode({
145
- --_bg: var(--yellow-200);
145
+ --_no-bg: var(--yellow-200);
146
146
  });
147
147
  }
148
148
  &__warning&__important {
149
- --_bc: var(--_bg);
150
- --_bg: var(--yellow-400);
151
- --_btn-focus-bg: var(--yellow-500);
152
- --_btn-active-bg: var(--yellow-600);
153
- --_fc: var(--black-900);
149
+ --_no-bc: var(--_no-bg);
150
+ --_no-bg: var(--yellow-400);
151
+ --_no-btn-focus-bg: var(--yellow-500);
152
+ --_no-btn-active-bg: var(--yellow-600);
153
+ --_no-fc: var(--black-900);
154
154
 
155
155
  .dark-mode({
156
- --_bg: var(--yellow-600);
157
- --_fc: var(--white);
156
+ --_no-bg: var(--yellow-600);
157
+ --_no-fc: var(--white);
158
158
  });
159
159
  .highcontrast-mode({
160
- --_bg: var(--yellow-700);
161
- --_fc: var(--white);
160
+ --_no-bg: var(--yellow-700);
161
+ --_no-fc: var(--white);
162
162
  });
163
163
  }
164
164
  }
@@ -168,7 +168,7 @@
168
168
  // This would reduce the amount of CSS we ship to the client and simplify our codebase
169
169
  .s-banner {
170
170
  .construct-notice-component();
171
- --_x-offset: 0;
171
+ --_no-x-offset: 0;
172
172
  // When we use .s-banner, we need to adjust the padding-top on
173
173
  // the body tag. This class correctly adjusts the body padding ONLY if
174
174
  // the notice is one line. If it wraps to multiple lines, more classes or
@@ -188,12 +188,12 @@
188
188
  }
189
189
  // If you want to hide and reveal the banner
190
190
  &[aria-hidden="true"] {
191
- --_x-offset: -50px; // TODO convert to su vars
191
+ --_no-x-offset: -50px; // TODO convert to su vars
192
192
  visibility: hidden;
193
193
  opacity: 0;
194
194
  }
195
195
  &[aria-hidden="false"] {
196
- --_x-offset: 49px; // TODO convert to su vars
196
+ --_no-x-offset: 49px; // TODO convert to su vars
197
197
  visibility: visible;
198
198
  opacity: 1;
199
199
  }
@@ -211,8 +211,8 @@
211
211
  position: fixed;
212
212
  width: 100%;
213
213
  z-index: calc(var(--zi-navigation-fixed) - 1); // Tuck below topbar
214
- -webkit-transform: translate3d(0, var(--_x-offset), 0);
215
- transform: translate3d(0, var(--_x-offset), 0);
214
+ -webkit-transform: translate3d(0, var(--_no-x-offset), 0);
215
+ transform: translate3d(0, var(--_no-x-offset), 0);
216
216
  }
217
217
 
218
218
  // Notice
@@ -11,50 +11,53 @@
11
11
  // ----------------------------------------------------------------------------
12
12
 
13
13
  .s-page-title {
14
- display: flex;
15
- flex-direction: row;
16
- justify-content: space-between;
17
- align-items: flex-end;
18
- width: 100%;
19
- padding-bottom: var(--su16);
20
- border-bottom: 1px solid var(--bc-medium);
21
-
14
+ --_pt-ai: flex-end;
15
+ --_pt-fd: row;
16
+ --_pt-actions-ml: var(--su8);
17
+ --_pt-actions-mt: unset;
18
+ --_pt-breadcrums-mb: var(--su8);
19
+
20
+ // CONTEXTUAL STYLES
21
+ #stacks-internals #screen-sm({
22
+ --_pt-breadcrums-mb: var(--su2);
23
+ });
22
24
  #stacks-internals #screen-md({
23
- flex-direction: column;
24
- align-items: flex-start;
25
+ --_pt-ai: flex-start;
26
+ --_pt-fd: column;
27
+ --_pt-actions-ml: 0;
28
+ --_pt-actions-mt: var(--su8);
25
29
  });
26
30
 
27
- .s-page-title--header {
28
- margin: 0;
29
- margin-bottom: 0;
30
- font-size: var(--fs-headline1);
31
- color: var(--fc-dark);
32
- line-height: var(--lh-sm);
33
- font-weight: normal;
31
+ // CHILD ELEMENTS
32
+ & &--actions {
33
+ margin-left: var(--_pt-actions-ml);
34
+ margin-top: var(--_pt-actions-mt);
35
+ flex-shrink: 0;
34
36
  }
35
-
36
- .s-page-title--description {
37
+ & &--description {
37
38
  color: var(--fc-light);
38
- margin-top: var(--su4);
39
- margin-bottom: 0;
40
39
  font-size: var(--fs-body2);
40
+ margin-bottom: 0;
41
+ margin-top: var(--su4);
41
42
  }
42
-
43
- .s-page-title--actions {
44
- margin-left: var(--su8);
45
- flex-shrink: 0;
46
-
47
- #stacks-internals #screen-md({
48
- margin-top: var(--su8);
49
- margin-left: 0;
50
- });
43
+ & &--header {
44
+ color: var(--fc-dark);
45
+ font-size: var(--fs-headline1);
46
+ font-weight: normal;
47
+ line-height: var(--lh-sm);
48
+ margin: 0;
49
+ margin-bottom: 0; // TODO: investigate why this exists. I assume it's so margin-bottom isn't overrode, but 🤷‍♂️
51
50
  }
52
-
53
51
  .s-breadcrumbs {
54
- margin-bottom: var(--su8);
55
-
56
- #stacks-internals #screen-sm({
57
- margin-bottom: var(--su2);
58
- });
52
+ margin-bottom: var(--_pt-breadcrums-mb);
59
53
  }
54
+
55
+ align-items: var(--_pt-ai);
56
+ flex-direction: var(--_pt-fd);
57
+
58
+ border-bottom: 1px solid var(--bc-medium);
59
+ display: flex;
60
+ justify-content: space-between;
61
+ padding-bottom: var(--su16);
62
+ width: 100%;
60
63
  }
@@ -1,55 +1,52 @@
1
- //
2
- // STACK OVERFLOW
3
- // PAGINATION
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
- // • BASE STYLE
11
- //
12
- // ============================================================================
13
- // $ BASE STYLE
14
- // ----------------------------------------------------------------------------
15
1
  .s-pagination {
16
- display: flex;
17
- flex-wrap: wrap;
18
- margin-left: calc(var(--su2) * -1);
19
- margin-right: calc(var(--su2) * -1);
20
- }
21
-
22
- .s-pagination--item {
23
- margin-left: var(--su2);
24
- margin-right: var(--su2);
25
- padding: 0 var(--su8);
26
- background-color: transparent;
27
- border-radius: var(--br-sm);
28
- border: 1px solid var(--bc-medium);
29
- font-size: var(--fs-body1);
30
- line-height: var(--lh-xl);
31
- color: var(--fc-medium);
2
+ & &--item {
3
+ --_pa-item-bg: transparent;
4
+ --_pa-item-bc: var(--bc-medium);
5
+ --_pa-item-fc: var(--fc-medium);
6
+ // hover
7
+ --_pa-item-bg-hover: var(--black-100);
8
+ --_pa-item-bc-hover: var(--bc-darker);
9
+ --_pa-item-fc-hover: var(--fc-dark);
32
10
 
33
- .highcontrast-mode({ text-decoration: none; });
11
+ .highcontrast-mode({ text-decoration: none; });
34
12
 
35
- &:hover {
36
- border-color: var(--bc-darker);
37
- background-color: var(--black-100);
38
- color: var(--fc-dark);
39
- }
40
-
41
- &.is-selected {
42
- border-color: transparent;
43
- background-color: var(--theme-primary-color);
44
- color: var(--white);
45
- }
13
+ // MODIFIERS
14
+ &.is-selected {
15
+ --_pa-item-bg: var(--theme-primary-color);
16
+ --_pa-item-bc: transparent;
17
+ --_pa-item-fc: var(--white);
18
+ }
19
+ &&__clear {
20
+ --_pa-item-bg: transparent;
21
+ --_pa-item-bc: transparent;
22
+ --_pa-item-fc: inherit;
23
+ }
24
+ // override hover styles to match base styles
25
+ &.is-selected,
26
+ &&__clear {
27
+ --_pa-item-bc-hover: var(--_pa-item-bc);
28
+ --_pa-item-bg-hover: var(--_pa-item-bg);
29
+ --_pa-item-fc-hover: var(--_pa-item-fc);
30
+ }
46
31
 
47
- &.s-pagination--item__clear {
48
- &,
32
+ // INTERACTION
49
33
  &:hover {
50
- color: inherit;
51
- border-color: transparent;
52
- background-color: transparent;
34
+ background-color: var(--_pa-item-bg-hover);
35
+ border-color: var(--_pa-item-bc-hover);
36
+ color: var(--_pa-item-fc-hover);
53
37
  }
38
+
39
+ background-color: var(--_pa-item-bg);
40
+ border: 1px solid var(--_pa-item-bc);
41
+ color: var(--_pa-item-fc);
42
+
43
+ border-radius: var(--br-sm);
44
+ font-size: var(--fs-body1);
45
+ line-height: var(--lh-xl);
46
+ padding: 0 var(--su8);
54
47
  }
48
+
49
+ display: flex;
50
+ flex-wrap: wrap;
51
+ gap: var(--su4);
55
52
  }
@@ -334,7 +334,6 @@
334
334
  background-color: var(--red-600);
335
335
  }
336
336
 
337
-
338
337
  .s-post-summary--meta-tags {
339
338
  // TODO: remove rule for `a`, `.post-tag` once Core replaces `.post-tag` with `.s-tag`
340
339
  a,
@@ -351,36 +350,6 @@
351
350
  }
352
351
 
353
352
  .s-post-summary__ignored {
354
-
355
- .s-post-summary--stats {
356
- color: var(--black-500);
357
-
358
- .s-post-summary--stats-item {
359
-
360
- &.is-warm,
361
- &.is-hot,
362
- &.is-supernova {
363
- color: var(--black-500);
364
- }
365
-
366
- &.has-answers {
367
- color: var(--black-600);
368
- border: 1px solid var(--black-075);
369
- background-color: var(--black-075);
370
-
371
- .has-accepted-answer {
372
- color: var(--black-600);
373
- background-color: var(--black-075);
374
- border-color: var(--black-075);
375
- }
376
- }
377
- }
378
-
379
- .s-post-summary--stats-item__emphasized {
380
- color: var(--black-500);
381
- }
382
- }
383
-
384
353
  .s-post-summary--meta-tags {
385
354
  // TODO: remove rule for `a`, `.post-tag` once Core replaces `.post-tag` with `.s-tag`
386
355
  a,
@@ -417,7 +386,6 @@
417
386
  color: var(--black-600);
418
387
  }
419
388
 
420
-
421
389
  .s-post-summary--meta-tags {
422
390
  // TODO: remove rule for `a`, `.post-tag` once Core replaces `.post-tag` with `.s-tag`
423
391
  a,
@@ -433,6 +401,35 @@
433
401
  }
434
402
  }
435
403
 
404
+ .s-post-summary--stats {
405
+ color: var(--black-500);
406
+
407
+ .s-post-summary--stats-item {
408
+
409
+ &.is-warm,
410
+ &.is-hot,
411
+ &.is-supernova {
412
+ color: var(--black-500);
413
+ }
414
+
415
+ &.has-answers {
416
+ color: var(--black-500);
417
+ background-color: transparent;
418
+ border-color: var(--black-300);
419
+
420
+ &.has-accepted-answer {
421
+ color: var(--black-600);
422
+ background-color: var(--black-075);
423
+ border-color: transparent;
424
+ }
425
+ }
426
+ }
427
+
428
+ .s-post-summary--stats-item__emphasized {
429
+ color: var(--black-500);
430
+ }
431
+ }
432
+
436
433
  .s-user-card {
437
434
  .s-badge {
438
435
  filter: grayscale(100%);