PluginProbe
Code Snippets / 3.10.0
Code Snippets v3.10.0
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 / manage / _snippets-table.scss

_snippets-table.scss in Code Snippets 3.10.0, at css/manage/_snippets-table.scss

271 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 @use '../common/badges';
2 @use '../common/list-table';
3 @use '../common/theme';
4
5 .column-name,
6 .column-type {
7 .dashicons {
8 font-size: 16px;
9 inline-size: 16px;
10 block-size: 16px;
11 vertical-align: middle;
12 }
13
14 .dashicons-clock {
15 vertical-align: middle;
16 }
17 }
18
19 // `.wp-list-table` prefix keeps this above WP 7.0's 40px control height so the boxed
20 // priority field stays 30px tall (below the 38px control token, which would stretch the
21 // table rows) and vertically aligned with the rest of the row.
22 .wp-list-table .priority-column input {
23 appearance: none;
24 background: #fff;
25 border: 1px solid theme.$control-border;
26 border-radius: 5px;
27 box-shadow: none;
28 box-sizing: border-box;
29 min-block-size: 30px;
30 block-size: 30px;
31 inline-size: 4em;
32
33 // Pin the box model so padding/margins/line-height match WP 6.9 regardless of WP 7.0's
34 // taller default control metrics; this keeps the value aligned in both the resting and
35 // hovered (native spinner) states.
36 padding-block: 0;
37 padding-inline: 8px;
38 margin-block: 0;
39 margin-inline: 1px;
40 line-height: 2;
41 color: #2c3337;
42 text-align: center;
43
44 &:disabled {
45 color: inherit;
46 }
47
48 &:hover, &:focus, &:active {
49 color: #000;
50 background-color: rgb(0 0 0 / 10%);
51 border-radius: 6px;
52 appearance: unset;
53
54 &:disabled {
55 color: inherit;
56 background-color: transparent;
57 }
58 }
59 }
60
61 .wp-list-table .is-expanded td.column-activate.activate {
62 /* fix for mobile layout */
63 display: table-cell !important;
64 }
65
66 .snippets-card-grid {
67 // Three equal-height cards per row; descriptions are clamped so height
68 // stays uniform regardless of text length. The compound selector wins
69 // over the base .code-snippets-cards auto-fill column rule, which is
70 // emitted later in the compiled stylesheet.
71 // minmax(0, 1fr) lets tracks shrink below their content's min-content
72 // width (wide footer button rows), which plain 1fr tracks cannot,
73 // preventing the grid from overflowing the page horizontally.
74 &.code-snippets-cards {
75 grid-template-columns: repeat(3, minmax(0, 1fr));
76
77 @media (width <= 1100px) {
78 grid-template-columns: repeat(2, minmax(0, 1fr));
79 }
80
81 @media (width <= 782px) {
82 grid-template-columns: minmax(0, 1fr);
83 }
84 }
85
86 .code-snippets-card {
87 min-inline-size: 0;
88 }
89
90 // Reveal the bulk-select checkbox on hover or keyboard focus, and keep
91 // every checkbox visible while any card in the grid is selected so an
92 // in-progress selection is never hidden.
93 .snippet-card-select {
94 opacity: 0;
95 transition: opacity 0.15s ease;
96
97 @media (prefers-reduced-motion: reduce) {
98 transition-duration: 0.01s;
99 }
100 }
101
102 .snippet-card-select:checked,
103 &.has-selection .snippet-card-select,
104 .code-snippets-card:hover .snippet-card-select,
105 .code-snippets-card:focus-within .snippet-card-select {
106 opacity: 1;
107 }
108
109 // Card body bands: header row, meta row, then a separated description.
110 .card-inner {
111 display: flex;
112 flex-flow: column;
113 gap: 16px;
114 }
115
116 .snippet-card-header {
117 display: flex;
118 align-items: center;
119 gap: 10px;
120
121 // Keep header content clear of the absolutely-positioned selection checkbox.
122 padding-inline-end: 32px;
123
124 > a {
125 @include badges.badge-link;
126 }
127
128 h3 {
129 margin: 0;
130 font-size: 18px;
131 font-weight: 700;
132 line-height: 1.5;
133
134 // Let the heading shrink inside the flex row so long names
135 // truncate instead of pushing the header icons out of the card.
136 min-inline-size: 0;
137
138 .snippet-name {
139 display: block;
140 color: theme.$accent;
141 text-decoration: none;
142 white-space: nowrap;
143 overflow: hidden;
144 text-overflow: ellipsis;
145 }
146 }
147
148 .extra-icons:empty {
149 display: none;
150 }
151
152 // The accent pill styling lives in common/_switch.scss; keep the
153 // switch from shrinking inside the flex card header.
154 input[type='checkbox']='checkbox'].switch {
155 flex-shrink: 0;
156 }
157 }
158
159 .snippet-card-meta {
160 display: flex;
161 align-items: center;
162 flex-wrap: wrap;
163 gap: 16px;
164 font-size: 14px;
165 line-height: 1.5;
166
167 .snippet-card-tags-label {
168 color: #646970;
169 }
170
171 .snippet-card-tags a {
172 color: theme.$accent;
173 text-decoration: none;
174 }
175
176 .snippet-card-modified {
177 color: var(--cs-color-text-muted);
178 }
179
180 &.has-tags .snippet-card-modified {
181 margin-inline-start: auto;
182 }
183 }
184
185 .snippet-description-content {
186 display: -webkit-box;
187 -webkit-box-orient: vertical;
188 -webkit-line-clamp: 2;
189 line-clamp: 2;
190 overflow: hidden;
191 font-size: 14px;
192 line-height: 1.5;
193 color: #646970;
194 border-block-start: 1px solid #dcdcde;
195 padding-block-start: 16px;
196 }
197
198 // Align the selection checkbox with the taller card header row.
199 .snippet-card-corner {
200 inset-block-start: 28px;
201 }
202
203 .code-snippets-card footer {
204 .button {
205 font-size: 14px;
206 line-height: 2.5714;
207 border-radius: 5px;
208 }
209
210 .button:not(.button-primary) {
211 background: transparent;
212 }
213 }
214
215 .kebab-menu-priority {
216 justify-content: space-between;
217
218 // Balances the shorter input so the row matches the height of the menu
219 // items above and below it.
220 padding-block: 5px;
221
222 input.snippet-priority {
223 inline-size: 52px;
224 block-size: 30px;
225
226 // WordPress sizes number inputs with a min-height, which would
227 // otherwise win over the height set here.
228 min-block-size: 0;
229 box-sizing: border-box;
230 margin: 0;
231 padding-block: 0;
232 padding-inline: 4px;
233 border: 1px solid #e2e2e4;
234 border-radius: 4px;
235 text-align: center;
236 color: #2c3337;
237 }
238 }
239 }
240
241 // Shared table-navigation layout for both snippet views and both toolbars:
242 // bulk actions, select all, tag filter and search on the left, with the item
243 // count, pagination and view toggle pinned to the far end of the row. The
244 // bottom toolbar repeats only the bulk actions and pagination group.
245 .snippets-list-view .tablenav {
246 block-size: auto;
247 margin-block-end: 16px;
248 }
249
250 .snippets-search-subtitle {
251 margin-block: 0 12px;
252 font-size: 14px;
253 font-style: italic;
254 color: #646970;
255 text-align: center;
256 display: flex;
257 align-items: center;
258 justify-content: center;
259 gap: 1em;
260 }
261
262 // Keep every table row the same height by clamping the description cell
263 // to two lines, matching the two-line name + row-actions column.
264 .snippets-list-view .wp-list-table td.column-desc .snippet-description-content {
265 display: -webkit-box;
266 -webkit-box-orient: vertical;
267 -webkit-line-clamp: 2;
268 line-clamp: 2;
269 overflow: hidden;
270 }
271