PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 1.1.1
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v1.1.1
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 / assets / css / comments-window.css

comments-window.css in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 1.1.1, at assets/css/comments-window.css

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