PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / css / common / list-table / _layout.scss

_layout.scss in Code Snippets trunk, at css/common/list-table/_layout.scss

376 lines 7.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 @use '../badges';
2 @use '../checkbox';
3 @use '../theme';
4
5 .column-name {
6 .extra-icons {
7 float: inline-end;
8 display: flex;
9 flex-wrap: wrap;
10 gap: 5px;
11 }
12
13 .dashicons-lock {
14 color: var(--cs-color-text-muted);
15 opacity: 0.7;
16
17 &:hover {
18 opacity: 1;
19 }
20 }
21 }
22
23 .active-snippet {
24 td, th {
25 background-color: rgb(120 200 230 / 6%);
26 }
27
28 th.check-column {
29 border-inline-start: 2px solid #2ea2cc;
30 }
31
32 .column-name > .snippet-name {
33 font-weight: 600;
34 }
35 }
36
37 .inactive-snippet {
38 a {
39 color: #579;
40
41 &:hover,
42 &:active,
43 &:focus {
44 color: #819db9;
45 box-shadow: none;
46 }
47
48 &:focus-visible {
49 outline: 2px solid var(--cs-color-accent);
50 }
51 }
52 }
53
54 .paging-input {
55 display: inline-flex;
56 align-items: center;
57 gap: 2px;
58 }
59
60 .wp-list-table {
61 .check-column input[type='checkbox']='checkbox'] {
62 @include checkbox.canonical;
63 }
64
65 // Shared cell rhythm for snippet and Cloud tables. Padding, rather than a
66 // fixed row height, keeps multi-line values comfortable and uncropped.
67 td,
68 th {
69 padding-block: 16px;
70 padding-inline: 8px;
71 }
72
73 th:first-child,
74 td:first-child {
75 padding-inline-start: 16px;
76 }
77
78 th:last-child,
79 td:last-child {
80 padding-inline-end: 16px;
81 }
82
83 // Shared horizontal rhythm for every snippet table, so the cloud table lines
84 // up with the snippets table rather than keeping the wider WordPress default.
85 th:not(.check-column),
86 td:not(.check-column) {
87 padding-inline: 8px;
88 }
89
90 td.column-id {
91 text-align: center;
92 }
93
94 tr {
95 background: var(--cs-color-surface);
96 }
97
98 ol, ul {
99 margin-block: 0 1.5em;
100 margin-inline: 1.5em 0;
101 }
102
103 ul {
104 list-style: disc;
105 }
106
107 .sortable-column-title {
108 display: flex;
109 }
110
111 th.sortable .list-table-sort-button,
112 th.sorted .list-table-sort-button {
113 display: flex;
114 flex-direction: row;
115 align-items: center;
116 inline-size: 100%;
117 margin: 0;
118 border: none;
119 background: none;
120 font: inherit;
121 color: var(--cs-color-accent);
122 cursor: pointer;
123 text-align: start;
124 overflow: hidden;
125 padding-block: 8px;
126 padding-inline: 0;
127 }
128
129 th.sortable .list-table-sort-button:focus-visible,
130 th.sorted .list-table-sort-button:focus-visible {
131 outline: 2px solid var(--cs-color-accent);
132 outline-offset: 2px;
133 border-radius: 5px;
134 }
135
136 // The type badge is wrapped in an unclassed link that lays out as an inline
137 // box shorter than the badge, so wrap the badge exactly and draw our own
138 // focus ring: the inherited one resolves to a transparent outline.
139 .column-type a {
140 display: inline-flex;
141 border-radius: 5px;
142
143 &:focus {
144 box-shadow: none;
145 }
146
147 &:focus-visible {
148 outline: 2px solid var(--cs-color-accent);
149 }
150 }
151
152 .row-actions {
153 color: var(--cs-color-text-muted);
154 position: relative;
155 inset-inline-start: 0;
156
157 // Anchor inline dashicons (e.g. the trash glyph on the Delete action) to
158 // the surrounding text. WP's `.wp-core-ui .button .dashicons` rule sets
159 // line-height: 1.9, which would drop the glyph below the link baseline,
160 // and the icon should inherit the link's colour rather than link blue.
161 .button .dashicons {
162 line-height: 1;
163 vertical-align: text-bottom;
164 color: inherit;
165 }
166
167 a:not(.delete) {
168 color: var(--cs-color-accent);
169
170 &:hover,
171 &:focus {
172 color: var(--cs-color-accent-hover);
173 box-shadow: none;
174 }
175
176 &:focus-visible {
177 outline: 2px solid var(--cs-color-accent);
178 }
179 }
180
181 // Row-action buttons render as plain inline links. On WP 7.0 the generic `.button`
182 // compatibility styling would otherwise give them a fill, border, radius and fixed
183 // height, so fully neutralise it here (this rule is emitted after the wp-admin layer
184 // at equal specificity, so it wins). Non-delete links inherit the accent text colour.
185 .button-link {
186 block-size: auto;
187 min-block-size: 0;
188 padding: 0;
189 border: 0;
190 border-radius: 0;
191 background: none;
192 box-shadow: none;
193 line-height: inherit;
194 font-weight: 400;
195 color: var(--cs-color-accent);
196
197 &:focus {
198 outline: 2px solid var(--cs-color-accent);
199 }
200
201 &:hover:not(:disabled),
202 &:focus:not(:disabled) {
203 background: none;
204 border: 0;
205 box-shadow: none;
206 }
207
208 &:hover:not(:disabled, .delete, .snippet-cloud-update),
209 &:focus:not(:disabled, .delete, .snippet-cloud-update) {
210 color: var(--cs-color-accent-hover);
211 }
212
213 &.delete {
214 color: var(--cs-color-error);
215 }
216
217 &.snippet-cloud-update {
218 color: #ff851b;
219 }
220 }
221
222 .snippet-row-action-feedback,
223 .snippet-row-action-error {
224 display: inline-flex;
225 align-items: center;
226 gap: .5em;
227
228 .components-spinner {
229 margin: 0;
230 inline-size: 1em;
231 block-size: 1em;
232 }
233 }
234
235 .snippet-row-action-error {
236 color: var(--cs-color-error);
237 }
238
239 .delete.disabled {
240 color: var(--cs-color-text-disabled);
241 cursor: not-allowed;
242 pointer-events: none;
243 }
244 }
245
246 .column-activate {
247 text-align: center;
248
249 .snippet-activation-switch,
250 input[type='checkbox']='checkbox'].switch {
251 margin-inline: auto;
252 }
253 }
254
255 .clear-filters {
256 vertical-align: middle;
257 }
258
259 thead th.check-column,
260 thead td.check-column,
261 tfoot th.check-column,
262 tfoot td.check-column,
263 tbody th.check-column,
264 tbody td.check-column {
265 padding-block: 16px;
266 padding-inline-start: 8px;
267 vertical-align: middle;
268 }
269
270 // Line every checkbox up on the same starting edge. Rows flagged as active
271 // draw a 2px accent border on this cell, so the same width is reserved as a
272 // transparent border elsewhere; without it the header, footer and inactive
273 // rows sit 2px further in, and rows shift as snippets are toggled.
274 thead th.check-column,
275 thead td.check-column,
276 tfoot th.check-column,
277 tfoot td.check-column,
278 tbody tr:not(.active-snippet) th.check-column,
279 tbody tr:not(.active-snippet) td.check-column {
280 border-inline-start: 2px solid transparent;
281 }
282
283 .active-snippet, .inactive-snippet {
284 td, th {
285 box-shadow: inset 0 -1px 0 rgb(0 0 0 / 10%);
286 vertical-align: middle;
287 }
288 }
289
290 tr.active-snippet + tr.inactive-snippet th,
291 tr.active-snippet + tr.inactive-snippet td {
292 border-block-start: 1px solid rgb(0 0 0 / 3%);
293 box-shadow: inset 0 1px 0 rgb(0 0 0 / 2%), inset 0 -1px 0 #e1e1e1;
294 }
295
296 .delete {
297 color: var(--cs-color-error);
298 }
299
300 a.delete:not(.disabled) {
301 &:hover, &:focus, &:active {
302 border-block-end: 1px solid #f00;
303 color: #f00;
304 }
305 }
306
307 td.column-date, th.column-date {
308 white-space: nowrap;
309 inline-size: 130px; /* fixed column width */
310 min-inline-size: 130px;
311 max-inline-size: 130px;
312 text-align: end;
313 overflow: hidden;
314 text-overflow: ellipsis;
315 }
316
317 td.column-date .modified-column-content {
318 display: block;
319 text-align: start;
320 }
321
322 // Names and descriptions are both governed by the "Truncate long snippet
323 // names and descriptions" Screen Option. When it is off, the name group may
324 // take the full cell; when on, it is capped and the name inside it
325 // truncates, with the full value available through the title attribute.
326 &.truncate-row-values td.column-name > .snippet-name-group {
327 display: flex;
328 max-inline-size: min(15rem, 30vw);
329 }
330
331 &.truncate-row-values td.column-desc .snippet-description-content {
332 display: block;
333 max-inline-size: min(25rem, 45vw);
334 overflow: clip;
335 text-overflow: ellipsis;
336 }
337 }
338
339 .snippets-table-toolbar {
340 display: flex;
341 justify-content: space-between;
342 align-items: center;
343
344 // The preceding page header owns the 16px gap above; a `wp-header-end` <hr>
345 // sits between them and prevents margin collapse, so this row keeps only its
346 // own 16px gap below (to the tablenav) and no top margin of its own.
347 margin-block: 0 16px;
348
349 .subsubsub {
350 display: flex;
351 align-items: center;
352 gap: 9px;
353 margin: 0;
354 padding: 0;
355 font-size: 13px;
356 line-height: 1.5;
357
358 li {
359 display: flex;
360 align-items: center;
361 gap: 9px;
362 margin: 0;
363 padding: 0;
364 }
365
366 // A thin vertical rule precedes every status after the first, sized to the
367 // 13px text rather than the taller line box.
368 li + li::before {
369 content: '';
370 inline-size: 1px;
371 block-size: 13px;
372 background: var(--cs-color-border);
373 }
374 }
375 }
376