PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.10
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.10
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
desktop-mode / apps / comments / comments.css

comments.css in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.10, at apps/comments/comments.css

641 lines 16.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*
2 * Comments app — two-pane conversation view.
3 *
4 * Thread rail (left) + nested conversation (right) + composer.
5 * Variables come from `variables.css`; this file just maps them onto
6 * the comments-specific markup so the window picks up theme +
7 * color-scheme changes for free. Controls that have a `<os-*>`
8 * component are styled through that component's documented custom
9 * properties rather than re-implemented here.
10 */
11
12 .os-comments {
13 box-sizing: border-box;
14 inline-size: 100%;
15 position: relative;
16 /* A query container, so the one-pane rules at the end of this file
17 track the WINDOW's width — a phone, or a desktop window pulled in. */
18 container-type: inline-size;
19 color: var( --os-ui-fg, #1d2327 );
20 }
21
22 /*
23 * Any element inside the comments window that opts into HTML's
24 * `hidden` attribute is hidden — full stop. Without this rule the
25 * `display: flex` on `__msg-actions` would win against the UA
26 * stylesheet's bare `[hidden]` selector (class beats element), and
27 * the action row would stay on screen underneath the inline comment
28 * editor that just replaced it. Authoritative single override.
29 */
30 .os-comments [hidden] {
31 display: none !important;
32 }
33
34 /*
35 * Local fallback for core's visually-hidden helper. wp-admin defines
36 * `.screen-reader-text` and the shell renders inside wp-admin, but the
37 * status dots and link hints below are meaningless without it — worth
38 * not depending on load order for.
39 */
40 .os-comments .screen-reader-text {
41 position: absolute;
42 width: 1px;
43 height: 1px;
44 margin: -1px;
45 padding: 0;
46 overflow: hidden;
47 clip-path: inset( 50% );
48 white-space: nowrap;
49 border: 0;
50 }
51
52 /* ── Tab strip ───────────────────────────────────────────────── */
53 /*
54 * `<os-tabs>` brings its own chrome, roving tabindex and focus ring.
55 * All that's needed here is the strip's place in the column and the
56 * count chip slotted into each `<os-tab>` (light DOM, so a plain
57 * descendant selector reaches it).
58 */
59 .os-comments__tabrow {
60 flex: 0 0 auto;
61 padding-inline: 12px;
62 border-block-end: 1px solid var( --os-ui-border, #dcdcde );
63 }
64
65 /* `<os-badge no-dot>` owns the pill — this is spacing only. */
66 .os-comments__tab-count {
67 --os-ui-badge-padding: 1px 6px;
68 --os-ui-badge-font: 500 11px/1.4 var( --os-font, system-ui );
69 margin-inline-start: 6px;
70 font-variant-numeric: tabular-nums;
71 }
72
73 /* ── Left rail ───────────────────────────────────────────────── */
74 .os-comments__rail {
75 display: flex;
76 flex-direction: column;
77 min-block-size: 0;
78 background: var( --os-ui-surface-sunken, #fbfbfc );
79 }
80
81 .os-comments__search {
82 padding: 12px;
83 flex: 0 0 auto;
84 }
85
86 .os-comments__search os-text-field {
87 display: block;
88 width: 100%;
89 }
90
91 .os-comments__list {
92 overflow-y: auto;
93 flex: 1 1 auto;
94 min-block-size: 0;
95 }
96
97 /* "Scoped to one post" banner at the top of the rail. */
98 .os-comments__rail-filter {
99 display: flex;
100 align-items: center;
101 justify-content: space-between;
102 gap: 8px;
103 padding: 8px 14px;
104 font-size: 12px;
105 background: color-mix( in srgb, var( --os-ui-accent, #2271b1 ) 8%, transparent );
106 border-block-end: 1px solid var( --os-ui-border, #dcdcde );
107 }
108 .os-comments__rail-filter-label {
109 color: var( --os-ui-fg, #1d2327 );
110 font-weight: 600;
111 overflow: hidden;
112 text-overflow: ellipsis;
113 white-space: nowrap;
114 }
115 .os-comments__rail-filter-clear {
116 flex: 0 0 auto;
117 --os-ui-button-padding: 0;
118 font-size: 12px;
119 }
120
121 /* `role="listitem"` wrapper — the row itself has to stay a button. */
122 .os-comments__thread-slot {
123 display: block;
124 }
125
126 .os-comments__thread {
127 display: grid;
128 grid-template-columns: 36px 1fr auto;
129 gap: 10px;
130 padding: 12px 14px;
131 cursor: pointer;
132 border-block-end: 1px solid color-mix( in srgb, currentColor 6%, transparent );
133 position: relative;
134 text-align: start;
135 appearance: none;
136 background: transparent;
137 border-inline: 0;
138 border-block-start: 0;
139 font: inherit;
140 color: inherit;
141 width: 100%;
142 }
143
144 .os-comments__thread:hover {
145 background: var( --os-ui-hover, rgba( 0, 0, 0, 0.045 ) );
146 }
147
148 .os-comments__thread:focus-visible {
149 outline: 2px solid var( --os-ui-accent, #2271b1 );
150 outline-offset: -2px;
151 }
152
153 .os-comments__thread.is-selected {
154 background: color-mix( in srgb, var( --os-ui-accent, #2271b1 ) 8%, transparent );
155 }
156
157 .os-comments__thread.is-selected::before {
158 content: "";
159 position: absolute;
160 inset-inline-start: 0;
161 inset-block: 0;
162 width: 3px;
163 background: var( --os-ui-accent, #2271b1 );
164 }
165
166 /* In-flight moderation on this conversation. */
167 .os-comments__thread.is-busy {
168 opacity: 0.5;
169 pointer-events: none;
170 }
171
172 /*
173 * Avatar. `<os-avatar>` owns the circle, the hue, the initials
174 * fallback and its own sizing (via the `size` attribute) — anything
175 * set here would be a light-DOM author style overriding the
176 * component's `:host` rules, so this stays to layout only.
177 */
178 .os-comments__disc {
179 flex: 0 0 auto;
180 }
181
182 .os-comments__thread-main {
183 min-width: 0;
184 }
185
186 .os-comments__thread-name {
187 font-size: 13.5px;
188 font-weight: 600;
189 color: var( --os-ui-fg, #1d2327 );
190 display: flex;
191 align-items: center;
192 gap: 6px;
193 }
194
195 .os-comments__thread-snip {
196 font-size: 12.5px;
197 color: var( --os-ui-fg-muted, #50575e );
198 margin-block-start: 2px;
199 white-space: nowrap;
200 overflow: hidden;
201 text-overflow: ellipsis;
202 }
203
204 .os-comments__thread-post {
205 font-size: 11.5px;
206 color: var( --os-ui-fg-faint, #787c82 );
207 margin-block-start: 3px;
208 white-space: nowrap;
209 overflow: hidden;
210 text-overflow: ellipsis;
211 }
212
213 /*
214 * The rail before its first answer: silhouettes where the
215 * conversations land. Same shimmer the table's skeleton rows wear,
216 * through the palette's skeleton pair.
217 */
218 .os-comments__thread-slot--ghost .os-comments__thread {
219 cursor: default;
220 pointer-events: none;
221 }
222
223 .os-comments__ghost {
224 display: block;
225 border-radius: 3px;
226 background: linear-gradient(
227 90deg,
228 var( --os-skeleton-low, rgba( 0, 0, 0, 0.06 ) ) 0%,
229 var( --os-skeleton-high, rgba( 0, 0, 0, 0.14 ) ) 50%,
230 var( --os-skeleton-low, rgba( 0, 0, 0, 0.06 ) ) 100%
231 );
232 background-size: 200% 100%;
233 animation: os-comments-ghost 1.4s ease-in-out infinite;
234 }
235
236 .os-comments__ghost--disc {
237 width: 36px;
238 height: 36px;
239 border-radius: 50%;
240 }
241
242 .os-comments__ghost--line {
243 height: 12px;
244 width: 70%;
245 margin-block-start: 4px;
246 }
247
248 .os-comments__ghost--short {
249 width: 45%;
250 }
251
252 @keyframes os-comments-ghost {
253 0% {
254 background-position: 200% 50%;
255 }
256 100% {
257 background-position: -200% 50%;
258 }
259 }
260
261 @media ( prefers-reduced-motion: reduce ) {
262 .os-comments__ghost {
263 animation: none;
264 }
265 }
266
267 .os-comments__thread-meta {
268 display: flex;
269 flex-direction: column;
270 align-items: flex-end;
271 gap: 6px;
272 flex: 0 0 auto;
273 }
274
275 .os-comments__thread-time {
276 font-size: 11px;
277 color: var( --os-ui-fg-faint, #787c82 );
278 font-variant-numeric: tabular-nums;
279 white-space: nowrap;
280 }
281
282 /*
283 * Rail status: a `<os-badge>` with no room for its label, so the pill
284 * collapses to the tone dot the component already paints. Driven
285 * through the badge's own variable surface rather than by overriding
286 * its `:host` rules from the light DOM — the tone palette still owns
287 * the colour. The label rides along as slotted screen-reader text, so
288 * the hue is never the only carrier of the meaning.
289 */
290 .os-comments__status {
291 --os-ui-badge-padding: 0;
292 --os-ui-badge-bg: transparent;
293 --os-ui-badge-border: 0;
294 --os-ui-badge-gap: 0;
295 flex: 0 0 auto;
296 position: relative;
297 }
298
299 .os-comments__reply-count {
300 --os-ui-badge-padding: 1px 6px;
301 --os-ui-badge-font: 500 10.5px/1.4 var( --os-font, system-ui );
302 font-variant-numeric: tabular-nums;
303 white-space: nowrap;
304 position: relative;
305 }
306
307 .os-comments__load-more {
308 display: flex;
309 justify-content: center;
310 padding: 12px;
311 }
312
313 /* ── Right pane: conversation ────────────────────────────────── */
314 .os-comments__convo {
315 display: flex;
316 flex-direction: column;
317 min-width: 0;
318 min-block-size: 0;
319 background: var( --os-ui-surface, #fff );
320 }
321
322 /* `<os-empty-state>` owns the icon + copy; this is placement only. */
323 .os-comments__placeholder {
324 margin: auto;
325 padding: 40px 24px;
326 display: block;
327 }
328
329 .os-comments__convo-head {
330 display: flex;
331 align-items: center;
332 justify-content: space-between;
333 gap: 12px;
334 padding: 14px 18px;
335 border-block-end: 1px solid var( --os-ui-border, #dcdcde );
336 flex: 0 0 auto;
337 }
338 .os-comments__convo-context {
339 min-width: 0;
340 }
341 .os-comments__convo-kicker {
342 font-size: 11px;
343 letter-spacing: 0.06em;
344 text-transform: uppercase;
345 color: var( --os-ui-fg-faint, #787c82 );
346 font-weight: 600;
347 }
348 .os-comments__convo-post {
349 font-size: 15px;
350 font-weight: 600;
351 color: var( --os-ui-fg, #1d2327 );
352 margin-block-start: 2px;
353 display: block;
354 overflow: hidden;
355 text-overflow: ellipsis;
356 white-space: nowrap;
357 }
358
359 /*
360 * The post title doubles as the "edit this post" affordance. The
361 * pencil sits at 55% opacity so the title reads as interactive at
362 * rest — a hover-only hint would be invisible to anyone who never
363 * hovers, and invisible on touch entirely.
364 */
365 a.os-comments__convo-post--editable {
366 text-decoration: none;
367 color: var( --os-ui-fg, #1d2327 );
368 }
369 .os-comments__convo-post-pencil {
370 margin-inline-start: 6px;
371 vertical-align: -2px;
372 opacity: 0.55;
373 color: var( --os-ui-fg-muted, #50575e );
374 }
375 a.os-comments__convo-post--editable:hover,
376 a.os-comments__convo-post--editable:focus-visible {
377 color: var( --os-ui-accent, #2271b1 );
378 text-decoration: underline;
379 }
380 a.os-comments__convo-post--editable:hover .os-comments__convo-post-pencil,
381 a.os-comments__convo-post--editable:focus-visible .os-comments__convo-post-pencil {
382 opacity: 1;
383 color: inherit;
384 }
385 a.os-comments__convo-post--editable:focus-visible {
386 outline: 2px solid var( --os-ui-accent, #2271b1 );
387 outline-offset: 2px;
388 border-radius: 3px;
389 }
390
391 .os-comments__convo-head-actions {
392 display: flex;
393 align-items: center;
394 gap: 8px;
395 flex: 0 0 auto;
396 }
397 .os-comments__convo-link {
398 color: var( --os-ui-accent, #2271b1 );
399 font-size: 12.5px;
400 text-decoration: none;
401 white-space: nowrap;
402 display: inline-flex;
403 align-items: center;
404 gap: 4px;
405 }
406 .os-comments__convo-link:hover { text-decoration: underline; }
407 .os-comments__convo-link:focus-visible {
408 outline: 2px solid var( --os-ui-accent, #2271b1 );
409 outline-offset: 2px;
410 border-radius: 3px;
411 }
412
413 /* The block editor's `external` glyph — inherits the link colour. */
414 .os-comments__ext-icon {
415 width: 18px;
416 height: 18px;
417 fill: currentColor;
418 flex: 0 0 auto;
419 }
420
421 .os-comments__thread-scroll {
422 padding: 18px 18px 6px;
423 overflow-y: auto;
424 flex: 1 1 auto;
425 min-block-size: 0;
426 }
427
428 /* A message + its nested children */
429 .os-comments__msg {
430 display: grid;
431 grid-template-columns: 34px 1fr;
432 gap: 12px;
433 }
434 .os-comments__msg-rail {
435 display: flex;
436 flex-direction: column;
437 align-items: center;
438 }
439 .os-comments__msg-line {
440 flex: 1 1 auto;
441 width: 2px;
442 background: var( --os-ui-border, #dcdcde );
443 margin-block-start: 6px;
444 border-radius: 2px;
445 }
446 .os-comments__msg-body {
447 min-width: 0;
448 padding-block-end: 12px;
449 }
450 .os-comments__msg-head {
451 display: flex;
452 align-items: baseline;
453 gap: 8px;
454 flex-wrap: wrap;
455 }
456 .os-comments__msg-name {
457 font-weight: 600;
458 font-size: 13.5px;
459 color: var( --os-ui-fg, #1d2327 );
460 }
461 .os-comments__msg-you {
462 --os-ui-badge-padding: 0 5px;
463 --os-ui-badge-font: 600 10.5px/1.4 var( --os-font, system-ui );
464 }
465 .os-comments__msg-time {
466 font-size: 11.5px;
467 color: var( --os-ui-fg-faint, #787c82 );
468 font-variant-numeric: tabular-nums;
469 }
470
471 /*
472 * Status chip on any message that isn't approved. A pending reply
473 * buried in an approved thread is exactly what a moderator is
474 * looking for — the tint alone doesn't carry that.
475 */
476 /* Tone + pill come from `<os-badge>`; only the metrics are ours. */
477 .os-comments__msg-status {
478 --os-ui-badge-padding: 0 5px;
479 --os-ui-badge-font: 600 10.5px/1.4 var( --os-font, system-ui );
480 }
481
482 .os-comments__msg[ data-status="spam" ] .os-comments__msg-text,
483 .os-comments__msg[ data-status="trash" ] .os-comments__msg-text {
484 opacity: 0.65;
485 }
486
487 .os-comments__msg-text {
488 font-size: 13.5px;
489 line-height: 1.5;
490 color: var( --os-ui-fg, #2c3338 );
491 margin-block-start: 4px;
492 overflow-wrap: anywhere;
493 }
494
495 /*
496 * Per-message inline actions — always visible, the whole point.
497 *
498 * Styled as wp-admin's own comment row actions: chrome-less links
499 * separated by pipes (`Approve | Reply | Edit | Spam | Trash`) rather
500 * than a row of buttons. Each pipe is a real `__act-sep` node the view
501 * places between the actions this viewer actually got (every button
502 * is a shadow host, so generated content on it is at the mercy of
503 * slotting), never dangling at either end.
504 */
505 .os-comments__msg-actions {
506 display: flex;
507 align-items: center;
508 gap: 8px;
509 margin-block-start: 8px;
510 flex-wrap: wrap;
511 font-size: 12.5px;
512 }
513
514 .os-comments__act {
515 --os-ui-button-padding: 0;
516 --os-ui-button-fg: var( --os-ui-accent, #2271b1 );
517 font-size: 12.5px;
518 line-height: 1.4;
519 }
520
521 /*
522 * The separator belongs to the row, not to either link — so it stays
523 * out of the underline, out of both hit targets, and (via
524 * `aria-hidden`) out of the accessibility tree.
525 */
526 .os-comments__act-sep {
527 color: var( --os-ui-fg-faint, #c3c4c7 );
528 user-select: none;
529 pointer-events: none;
530 }
531
532 .os-comments__act.is-danger {
533 --os-ui-button-fg: var( --os-ui-danger, #b32d2e );
534 }
535
536 .os-comments__nested {
537 margin-block-start: 12px;
538 }
539
540 /* ── Composer ────────────────────────────────────────────────── */
541 .os-comments__composer {
542 border-block-start: 1px solid var( --os-ui-border, #dcdcde );
543 background: var( --os-ui-surface-elevated, #f6f7f7 );
544 padding: 12px 18px 16px;
545 flex: 0 0 auto;
546 }
547 .os-comments__composer.is-empty {
548 display: none;
549 }
550 .os-comments__composer-to {
551 font-size: 12px;
552 color: var( --os-ui-fg-muted, #50575e );
553 margin-block-end: 8px;
554 }
555 .os-comments__composer-to b {
556 color: var( --os-ui-fg, #1d2327 );
557 }
558 .os-comments__composer-row {
559 display: flex;
560 align-items: center;
561 justify-content: flex-end;
562 gap: 8px;
563 margin-block-start: 10px;
564 }
565 .os-comments__composer-hint {
566 font-size: 11.5px;
567 color: var( --os-ui-fg-faint, #787c82 );
568 margin-inline-end: auto;
569 }
570
571 .os-comments__reply-input {
572 display: block;
573 width: 100%;
574 }
575
576 /* Cursor override: the shell forces `cursor: default !important`. */
577 body.os-active .os-comments__thread,
578 body.os-active .os-comments__convo-link,
579 body.os-active a.os-comments__convo-post--editable {
580 cursor: pointer !important;
581 }
582
583 /* ── Narrow windows: one pane at a time ─────────────────────────── */
584 /*
585 * A phone, or a desktop window pulled in. The split cannot hold two
586 * panes, so it holds one: the rail (the list of conversations) until
587 * a conversation is picked, then the conversation, with a Back control
588 * in its head that returns to the list. The view stamps which pane
589 * is up as `data-os-comments-pane` on the root; at a wide width the
590 * stamp changes nothing, both panes are always up. The tab strip
591 * becomes a picker the same way (`data-os-comments-tabselect`, rendered
592 * beside the strip), so five tabs with counts do not wrap into two
593 * rows above a 360px list.
594 *
595 * Two ways in, the same rules twice: a container query for a window
596 * pulled narrow on a desk, and the shell's phone mode
597 * (`html[data-os-mode="mobile"]`), which is the phone experience at
598 * ANY width — a developer previewing it in a wide browser, a phone
599 * turned sideways past 720px — and cannot be expressed as a size. The
600 * rail is never hidden outright: on a phone it IS the list of
601 * conversations.
602 */
603 .os-comments__tabselect {
604 display: none;
605 padding: 8px 12px;
606 border-block-end: 1px solid var( --os-ui-border, #dcdcde );
607 flex: 0 0 auto;
608 }
609 .os-comments__convo-back {
610 display: none;
611 flex: 0 0 auto;
612 }
613
614 @container ( max-width: 720px ) {
615 .os-comments__tabrow {
616 display: none;
617 }
618 .os-comments__tabselect {
619 display: block;
620 }
621 .os-comments__convo-back {
622 display: inline-flex;
623 }
624 .os-comments__convo-head {
625 padding: 10px 12px;
626 }
627 }
628
629 html[data-os-mode="mobile"] .os-comments__tabrow {
630 display: none;
631 }
632 html[data-os-mode="mobile"] .os-comments__tabselect {
633 display: block;
634 }
635 html[data-os-mode="mobile"] .os-comments__convo-back {
636 display: inline-flex;
637 }
638 html[data-os-mode="mobile"] .os-comments__convo-head {
639 padding: 10px 12px;
640 }
641