@stackoverflow/stacks 3.0.0-beta.21 → 3.0.0-beta.23

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.
@@ -1,458 +1,291 @@
1
1
  .s-post-summary {
2
- // --_ps-state-* are custom properties to broadly override colors for a given post summary state
3
- --_ps-bb: var(--su1) solid var(--bc-light);
4
- --_ps-bg: unset;
5
- --_ps-o: unset;
6
- // Child components
7
- --_ps-content-excerpt-fc: var(--_ps-state-fc, var(--fc-medium));
8
- --_ps-content-title-a-fc: var(--_ps-state-fc, var(--theme-post-title-color, var(--theme-link-color, var(--theme-secondary))));
9
- --_ps-content-title-a-fc-hover: var(--_ps-state-fc, var(--theme-post-title-color-hover, var(--theme-link-color-hover, var(--theme-secondary-500))));
10
- --_ps-content-title-a-fc-visited: var(--_ps-state-fc, var(--theme-post-title-color-visited, var(--theme-link-color-visited, var(--purple-500))));
11
- --_ps-content-title-a-fc-hover-visited: var(--_ps-state-fc, var(--theme-post-title-color-hover, var(--theme-link-color-hover, var(--purple-600))));
12
- --_ps-stats-ai: flex-end;
13
- --_ps-stats-fc: var(--_ps-state-fc, var(--fc-light));
14
- --_ps-stats-fd: column;
15
- --_ps-stats-w: calc(var(--su96) + var(--su12));
16
- // Stats item modifiers
17
- --_ps-has-answers-bc: var(--green-400);
18
- --_ps-has-answers-bg: unset;
19
- --_ps-has-answers-fc: var(--green-400);
20
- --_ps-has-accepted-answers-bc: var(--green-400);
21
- --_ps-has-accepted-answers-bg: var(--green-400);
22
- --_ps-has-accepted-answers-fc: var(--white);
23
- --_ps-stats-item-emphasized-fc: var(--_ps-state-fc, var(--fc-dark));
24
-
25
- // CONTEXTUAL STYLES
26
- #stacks-internals #screen-md({
27
- --_ps-stats-ai: center;
28
- --_ps-stats-fd: row;
29
- --_ps-stats-w: auto;
30
-
31
- flex-direction: column;
2
+ @psx-container-sm: 28rem;
3
+ --_ps-answer-icon-fc: unset;
4
+ --_ps-content-type-bc: var(--black-200);
5
+ --_ps-content-type-bg: var(--black-050);
6
+ --_ps-content-type-fc: var(--black-600);
7
+ --_ps-stats-answers-bg: unset;
8
+ --_ps-stats-answers-fc: var(--black-400);
9
+ --_ps-stats-answers-fw: unset;
10
+ --_ps-stats-answers-icon-fc: unset;
11
+ --_ps-title-link-fc: var(--theme-secondary-600);
12
+
13
+ // Conditional styles
14
+ .highcontrast-mode({
15
+ &__deleted * {
16
+ --_ps-ignored-fc: var(--black-500);
17
+ }
32
18
  });
33
19
 
34
- // MODIFIERS
35
- &&__minimal,
36
- & &--answer {
37
- --_ps-stats-ai: center;
38
- --_ps-stats-fd: row;
39
- --_ps-stats-w: auto;
20
+ // Note: we cannot use CSS custom properties for container query values
21
+ @container post-summary (width <= @psx-container-sm) {
22
+ .s-post-summary--sm-hide {
23
+ display: none !important;
24
+ }
25
+ .s-post-summary--sm-show {
26
+ display: flex !important;
27
+ }
40
28
  }
41
29
 
42
- &&__minimal {
43
- .s-post-summary--content {
44
- width: 100%;
30
+ @container post-summary (width > @psx-container-sm) {
31
+ .s-post-summary--sm-hide {
32
+ display: flex !important;
33
+ }
34
+ .s-post-summary--sm-show {
35
+ display: none !important;
45
36
  }
37
+ }
46
38
 
47
- flex-direction: column;
39
+ // MODIFIERS
40
+ &&__answered {
41
+ --_ps-stats-answers-bg: var(--green-400);
42
+ --_ps-stats-answers-fc: var(--white);
43
+ --_ps-stats-answers-fw: 600;
44
+ --_ps-stats-answers-icon-fc: var(--green-400);
48
45
  }
49
46
 
50
- // VARIANTS
51
47
  &&__deleted,
52
- &&__ignored {
53
- --_ps-o: 0.75;
54
- --_ps-has-answers-bc: var(--black-350);
55
- --_ps-has-answers-bg: transparent;
56
- --_ps-has-answers-fc: var(--_ps-state-fc);
57
- --_ps-has-accepted-answers-bc: transparent;
58
- --_ps-has-accepted-answers-bg: var(--black-150);
59
- --_ps-has-accepted-answers-fc: var(--_ps-state-fc);
60
- --_ps-meta-tags-tag-bg: var(--black-150);
61
- --_ps-meta-tags-tag-fc: var(--_ps-state-fc);
62
- --_ps-state-fc: var(--black-400);
63
-
64
- .s-post-summary--meta-tags {
65
- a, // TODO: remove rule for `a` once Core replaces `.post-tag` with `.s-tag`
66
- .post-tag,
67
- .s-tag {
68
- &,
69
- &:active,
70
- &:hover,
71
- &:focus,
72
- .focus-bordered {
73
- .highcontrast-mode({
74
- border-color: currentColor;
75
- });
76
-
77
- background-color: var(--_ps-meta-tags-tag-bg);
78
- color: var(--black-500);
79
- border-color: var(--black-300);
80
- }
81
- }
48
+ &:has(.s-tag.s-tag__ignored) {
49
+ --_ps-ignored-bg: var(--black-100);
50
+ --_ps-ignored-fc: var(--black-400);
51
+
52
+ &.s-post-summary__answered {
53
+ --_ps-stats-answers-bg: var(--_ps-ignored-bg);
54
+ --_ps-stats-answers-fc: var(--_ps-ignored-fc);
55
+ --_ps-stats-answers-icon-fc: var(--black-350);
82
56
  }
83
57
 
84
- .s-user-card {
85
- a,
86
- .s-user-card--link,
87
- .s-user-card--rep,
88
- .s-user-card--time {
89
- color: var(--_ps-state-fc);
90
- }
91
-
92
- .s-badge {
93
- filter: grayscale(100%);
94
- }
58
+ * {
59
+ color: var(--_ps-ignored-fc) !important;
95
60
  }
96
- }
97
- &&__deleted,
98
- &&__watched {
99
- background-color: var(--_ps-bg);
100
- }
101
61
 
102
- &&__deleted {
103
- --_ps-bg: var(--red-100);
104
- --_ps-has-accepted-answers-bg: var(--black-200);
105
- --_ps-has-accepted-answers-fc: var(--black-500);
106
- --_ps-meta-tags-tag-bg: var(--black-200);
107
-
108
- .is-deleted,
109
- .s-badge__danger.s-badge__filled {
110
- .dark-mode({
111
- background-color: var(--red-600);
112
- color: var(--white);
113
- });
62
+ .s-avatar {
63
+ opacity: 0.5;
64
+ }
114
65
 
115
- background-color: var(--red-500);
66
+ .s-user-card--rep .s-bling:before {
67
+ background-color: var(--_ps-ignored-fc) !important;
116
68
  }
117
- }
118
69
 
119
- &&__watched {
120
- &:not(.s-post-summary__deleted):not(.s-post-summary__ignored) {
121
- --_ps-bg: var(--yellow-100);
122
- --_ps-stats-fc: var(--black-400);
123
- --_ps-content-title-a-fc: var(--theme-post-title-color, var(--theme-link-color, var(--theme-secondary)));
124
- --_ps-content-title-a-fc-hover: var(--theme-post-title-color-hover, var(--theme-link-color-hover, var(--theme-secondary-500)));
125
- --_ps-content-title-a-fc-visited: var(--theme-post-title-color-visited, var(--theme-link-color-visited, var(--purple-500)));
126
- --_ps-content-title-a-fc-hover-visited: var(--theme-post-title-color-hover, var(--theme-link-color-hover, var(--purple-600)));
127
-
128
- .s-user-card {
129
- a {
130
- &:active,
131
- &:hover {
132
- color: var(--_ps-content-title-a-fc-hover);
133
- }
134
-
135
- &:visited {
136
- &:hover {
137
- color: var(--_ps-content-title-a-fc-hover-visited);
138
- }
139
-
140
- color: var(--_ps-content-title-a-fc-visited);
141
- }
142
-
143
- color: var(--_ps-content-title-a-fc);
144
- }
145
-
146
- .s-user-card--rep,
147
- .s-user-card--time {
148
- color: var(--black-500);
149
- }
150
- }
70
+ .s-badge,
71
+ .s-tag,
72
+ .s-post-summary--stats-bounty {
73
+ background-color: var(--_ps-ignored-bg) !important;
74
+ border-color: var(--_ps-ignored-bg) !important;
75
+ color: var(--_ps-ignored-fc) !important;
151
76
  }
152
77
  }
153
78
 
154
- &:last-child {
155
- --_ps-bb: none;
79
+ &&__deleted {
80
+ background-color: var(--red-100);
81
+ border: var(--su8) solid var(--red-100);
156
82
  }
157
83
 
158
- // Child Elements
159
- & & {
160
- &--answer {
161
- & + & {
162
- margin-top: var(--su16);
163
- }
84
+ // Child components
85
+ .s-tag.s-tag__watched {
86
+ --_ta-bc: var(--yellow-200);
87
+ --_ta-bg: var(--yellow-200);
88
+ --_ta-fc: var(--yellow-600);
89
+ --_ta-bc-hover: var(--yellow-200);
90
+ --_ta-bg-hover: var(--yellow-200);
91
+ }
164
92
 
165
- &:before {
166
- .highcontrast-mode({
167
- background: var(--black-500);
168
- });
169
-
170
- background: var(--black-250);
171
- border-radius: var(--su8);
172
- bottom: 0;
173
- content: "";
174
- display: block;
175
- left: 0;
176
- position: absolute;
177
- top: 0;
178
- width: var(--su4);
179
- }
93
+ // TODO SHINE complete answers styling
94
+ & &--answers {
95
+ display: flex;
96
+ flex-direction: column;
97
+ gap: var(--su16);
98
+ padding-top: calc(var(--su8) + var(--su2)); // 10px
99
+ }
180
100
 
181
- margin: var(--su16) 1em 0 1em;
182
- padding: 0.5em 0 0.5em calc(1em + var(--su4));
183
- position: relative;
101
+ & &--answer {
102
+ &__accepted {
103
+ --_ps-answer-icon-fc: var(--green-400);
184
104
  }
185
105
 
186
- &--answer-excerpt {
187
- .v-truncate4;
188
- color: var(--black-500);
189
- margin-bottom: var(--su8);
106
+ .s-post-summary--stats-answers--icon {
107
+ color: var(--_ps-answer-icon-fc);
190
108
  }
191
109
 
192
- &--content {
193
- > *:not(.s-post-summary--content-menu-button):not(.s-post-summary--meta):not(.s-popover) {
194
- opacity: var(--_ps-o);
195
- }
196
-
197
- flex-grow: 1;
198
- max-width: 100%;
199
- }
110
+ border-left: var(--su4) solid var(--black-200);
111
+ display: flex;
112
+ flex-direction: column;
113
+ gap: var(--su6);
114
+ padding-left: var(--su8);
115
+ }
200
116
 
201
- &--content-excerpt {
202
- &.s-post-summary--content-excerpt {
203
- &__sm {
204
- .v-truncate1;
205
- }
117
+ & &--content {
118
+ display: flex;
119
+ flex-direction: column;
120
+ gap: var(--su4);
121
+ width: 100%;
122
+ }
206
123
 
207
- &__md {
208
- .v-truncate3;
209
- }
124
+ & &--content-meta {
125
+ align-items: center;
126
+ color: var(--black-400);
127
+ display: flex;
128
+ flex-wrap: wrap;
129
+ font-size: var(--fs-caption);
130
+ gap: var(--su6);
131
+ margin-bottom: var(--su4);
132
+ }
210
133
 
211
- &__lg {
212
- .v-truncate4;
213
- }
214
- }
134
+ & &--content-type {
135
+ &:focus-visible {
136
+ .focus-styles();
137
+ }
215
138
 
216
- .break-word;
217
- .v-truncate2;
218
- color: var( --_ps-content-excerpt-fc);
219
- font-family: var(--theme-post-body-font-family, var(--theme-body-font-family));
220
- margin-top: var(--sun2);
221
- margin-bottom: var(--su8);
139
+ &:hover {
140
+ --_ps-content-type-bc: var(--black-150);
141
+ --_ps-content-type-bg: var(--black-100);
142
+ --_ps-content-type-fc: var(--black-600);
222
143
  }
223
144
 
224
- &--content-menu-button {
225
- .svg-icon {
226
- margin: 0 !important;
227
- }
145
+ border: var(--su-static1) solid var(--_ps-content-type-bc);
146
+ background-color: var(--_ps-content-type-bg);
147
+ color: var(--_ps-content-type-fc);
228
148
 
229
- &,
230
- &.s-btn { // To override .s-btn class attributes
231
- padding: var(--su8);
232
- position: absolute;
233
- }
149
+ display: flex;
150
+ align-items: center;
151
+ gap: var(--su4);
152
+ padding: 0 var(--su4);
153
+ font-size: var(--fs-caption);
154
+ }
234
155
 
235
- right: var(--su8);
236
- top: var(--su8);
237
- }
156
+ & &--excerpt {
157
+ line-height: 1.25rem; // TODO use a standard line-height variable (currently 20px)
158
+ margin-bottom: 0;
159
+ }
238
160
 
239
- &--content-title {
240
- a {
241
- &:active,
242
- &:hover {
243
- color: var(--_ps-content-title-a-fc-hover);
244
- }
245
- &:visited {
246
- &:hover {
247
- color: var(--_ps-content-title-a-fc-hover-visited);
248
- }
249
-
250
- color: var(--_ps-content-title-a-fc-visited);
251
- }
252
-
253
- .break-word;
254
- color: var(--_ps-content-title-a-fc);
255
- font-family: var(--theme-post-title-font-family, var(--theme-body-font-family));
256
- }
161
+ & &--stats {
162
+ &.s-post-summary--sm-hide {
163
+ .s-post-summary--stats-answers {
164
+ background-color: var(--_ps-stats-answers-bg);
165
+ color: var(--_ps-stats-answers-fc);
166
+ font-weight: var(--_ps-stats-answers-fw);
257
167
 
258
- .iconShield {
259
- color: var(--fc-light);
168
+ align-items: center;
169
+ display: flex;
170
+ gap: var(--su4);
171
+ justify-content: center;
172
+ padding: var(--su4);
260
173
  }
261
174
 
262
- .svg-icon {
263
- position: relative;
264
- top: var(--sun1);
265
- vertical-align: text-bottom; // Optical alignment
175
+ .s-post-summary--stats-bounty {
176
+ align-items: center;
177
+ background-color: var(--blue-400);
178
+ color: var(--white);
179
+ display: flex;
180
+ gap: var(--su2);
181
+ font-weight: 600;
182
+ justify-content: center;
183
+ padding: var(--su4);
266
184
  }
267
185
 
268
- .break-word;
269
- display: block;
270
- font-size: var(--fs-body3);
271
- font-weight: normal;
272
- line-height: var(--lh-md);
273
- margin-bottom: 0.3365rem;
274
- margin-top: -0.125rem; // Optical alignment to compensate for title's containing block
275
- padding-right: var(--su24);
276
- }
277
-
278
- &--content-type {
279
- .svg-icon {
280
- color: var(--fc-light);
281
- margin-left: var(--sun2);
186
+ .s-post-summary--stats-votes {
187
+ align-items: center;
188
+ aspect-ratio: 1/1;
189
+ border: var(--su1) solid var(--black-200);
190
+ display: flex;
191
+ justify-content: center;
192
+ font-size: var(--fs-body2);
193
+ font-weight: 600;
194
+ margin-bottom: var(--su2);
195
+ padding: var(--su4);
196
+ width: calc(var(--su48) + var(--su8)); // 3.5rem
282
197
  }
283
198
 
284
- color: var(--fc-medium);
285
- margin-bottom: var(--su4);
199
+ flex-direction: column;
286
200
  }
287
201
 
288
- &--meta {
289
- > *:not(.s-post-summary--meta-tags):not(.s-user-card) > * {
290
- opacity: var(--_ps-o);
291
- }
292
-
293
- .s-user-card {
294
- > *:not(.magic-popup) {
295
- opacity: var(--_ps-o);
296
- }
297
-
298
- flex-wrap: wrap;
299
- justify-content: flex-end;
300
- margin-left: auto;
202
+ &.s-post-summary--sm-show {
203
+ .s-post-summary--stats-answers--icon {
204
+ color: var(--_ps-stats-answers-icon-fc);
301
205
  }
302
206
 
303
207
  align-items: center;
304
- column-gap: var(--su6);
305
- display: flex;
306
- flex-wrap: wrap;
307
- justify-content: space-between;
308
- row-gap: var(--su8);
208
+ justify-content: center;
209
+ padding: var(--su4);
309
210
  }
310
211
 
311
- &--meta-tags {
312
- > ul > li > a,
313
- > a,
314
- .post-tag,
315
- .s-tag {
316
- opacity: var(--_ps-o);
317
- }
318
-
212
+ .s-post-summary--stats-bounty {
213
+ align-items: center;
214
+ justify-content: center;
215
+ background-color: var(--blue-400);
216
+ color: var(--white);
319
217
  display: flex;
320
- flex-wrap: wrap;
321
- gap: var(--su4);
218
+ gap: var(--su1);
219
+ padding: 0 calc(var(--su4) - var(--su1));
322
220
  }
323
221
 
324
- &--stats {
325
- > *:not(.s-badge__danger) {
326
- opacity: var(--_ps-o);
327
- }
328
-
329
- align-items: var(--_ps-stats-ai);
330
- color: var(--_ps-stats-fc);
331
- flex-direction: var(--_ps-stats-fd);
332
- width: var(--_ps-stats-w);
222
+ display: flex;
223
+ gap: var(--su6);
224
+ font-size: var(--fs-caption);
225
+ }
333
226
 
334
- display: flex;
335
- flex-shrink: 0;
336
- flex-wrap: wrap;
337
- font-size: var(--fs-body1);
338
- gap: var(--su6);
339
- margin-bottom: var(--su4);
340
- margin-right: var(--su16);
227
+ & &--stats-item {
228
+ &:before {
229
+ aspect-ratio: 1/1;
230
+ background-color: var(--black-300);
231
+ content: "";
232
+ display: block;
233
+ height: var(--su4);
341
234
  }
342
235
 
343
- &--stats-item {
344
- &:not(.s-badge) {
345
- &.is-deleted {
346
- color: var(--white);
347
- }
348
-
349
- align-items: center;
350
- border: var(--su1) solid transparent;
351
- display: inline-flex;
352
- gap: 0.3em;
353
- justify-content: center;
354
- white-space: nowrap;
355
- }
356
-
357
- &.s-badge {
358
- font-size: var(--fs-body1);
359
- line-height: var(--lh-md);
360
- padding: var(--su2) var(--su4);
361
- }
362
-
363
- &.has-answers,
364
- &.has-bounty, // TODO DEPRECATED: Remove .has-bounty styling
365
- &.is-archived,
366
- &.is-closed,
367
- &.is-deleted,
368
- &.is-draft,
369
- &.is-pinned,
370
- &.is-published,
371
- &.is-review {
372
- border-radius: var(--br-md);
373
- padding: var(--su2) var(--su4);
374
- }
375
-
376
- &.has-answers {
377
- &.has-accepted-answer {
378
- background-color: var(--_ps-has-accepted-answers-bg);
379
- border-color: var(--_ps-has-accepted-answers-bc);
380
- color: var(--_ps-has-accepted-answers-fc);
381
- }
382
-
383
- background-color: var(--_ps-has-answers-bg);
384
- border: var(--su1) solid var(--_ps-has-answers-bc);
385
- color: var(--_ps-has-answers-fc);
386
- }
387
-
388
- &.has-bounty { // TODO DEPRECATED: Remove and replace with references with `s-badge s-badge__bounty`
389
- background-color: var(--blue-500);
390
- color: var(--white);
391
- }
392
-
393
- // Hotness
394
- &.is-warm {
395
- color: var(--_ps-state-fc, var(--yellow-500));
396
- }
397
-
398
- &.is-hot {
399
- color: var(--_ps-state-fc, var(--orange-500));
400
- }
401
-
402
- &.is-supernova {
403
- color: var(--_ps-state-fc, var(--red-500));
404
- }
405
-
406
- // Status
407
- &.is-archived { // TODO DEPRECATED: Remove and replace with references with `s-badge s-badge__muted s-badge__icon`
408
- background-color: var(--black-225);
409
- border-color: var(--black-500);
410
- color: var(--black-600);
411
- }
412
-
413
- &.is-closed { // TODO DEPRECATED: Remove and replace with references with `s-badge s-badge__danger s-badge__icon`
414
- background-color: var(--red-300);
415
- border-color: var(--red-500);
416
- color: var(--red-600);
417
- }
418
-
419
- &.is-draft { // TODO DEPRECATED: Remove and replace with references with `s-badge s-badge__info s-badge__icon`
420
- background-color: var(--blue-300);
421
- border-color: var(--blue-500);
422
- color: var(--blue-600);
423
- }
236
+ align-items: center;
237
+ display: flex;
238
+ gap: var(--su6);
239
+ }
424
240
 
425
- &.is-pinned { // TODO DEPRECATED: Remove and replace with references with `s-badge s-badge__muted s-badge__filled s-badge__icon`
426
- background-color: var(--black-500);
427
- color: var(--white);
428
- }
241
+ & &--tags {
242
+ display: flex;
243
+ flex-wrap: wrap;
244
+ gap: var(--su8);
245
+ margin-top: var(--su6);
246
+ }
429
247
 
430
- &.is-published {
431
- background-color: var(--black-150);
432
- color: var(--black-600);
433
- }
248
+ & &--title {
249
+ display: flex;
250
+ gap: var(--su6);
251
+ line-height: 1.563rem; // TODO use a standard line-height variable (currently 25px)
252
+ }
434
253
 
435
- &.is-review { // TODO DEPRECATED: Remove and replace with references with `s-badge s-badge__warning s-badge__icon`
436
- background-color: var(--yellow-300);
437
- border-color: var(--yellow-500);
438
- color: var(--yellow-600);
439
- }
254
+ & &--title-link {
255
+ &:hover {
256
+ --_ps-title-link-fc: var(--theme-secondary-500);
440
257
 
441
- &__emphasized {
442
- color: var(--_ps-stats-item-emphasized-fc);
258
+ &:visited {
259
+ color: var(--theme-secondary-600);
443
260
  }
444
261
  }
445
262
 
446
- &--stats-item-number {
447
- font-weight: 500;
263
+ // TODO: Since custom property is not being applied for some reason, we're changing the color directly. Remove this once the custom property is fixed.
264
+ // I suspect this is because of restrictions on the `:visited` pseudo-class.
265
+ // See https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:visited#privacy_restrictions
266
+ &:visited {
267
+ color: var(--theme-secondary-400);
448
268
  }
449
269
 
270
+ color: var(--_ps-title-link-fc);
271
+ display: flex;
272
+ font-size: var(--fs-body3);
273
+ font-weight: 600;
274
+ gap: var(--su4);
275
+ margin-top: var(--su2);
276
+ }
277
+
278
+ & &--title-icon {
279
+ flex-shrink: 0;
450
280
  }
451
281
 
452
- background-color: var(--_ps-bg);
453
- border-bottom: var(--_ps-bb);
282
+ // Container query setup
283
+ container-type: inline-size;
284
+ container-name: post-summary;
454
285
 
286
+ color: var(--black-500);
455
287
  display: flex;
456
- padding: var(--su16);
288
+ gap: var(--su16);
457
289
  position: relative;
290
+ width: 100%;
458
291
  }