File size: 8,024 Bytes
2eae9f0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
/* == S67-T16 -- THE FORMAT CELLS DIALOG (Number and Border tabs) ================================

   The body of the kit's `ConfirmDialog`, which renders through `BodyPortal` as a direct child of
   <body>. Every class here is therefore TOP LEVEL or scoped to `.sheet-format-cells`, never to a
   sheet ancestor (a `.sheet-body ...` rule would be dead the moment the portal moved the node).

   Tokens only for chrome: no literal font-size, no hex. The one exception is not in this file:
   the line colour swatches and the preview's lines are the person's DATA (DESIGN.md 3) and take
   their hex inline from the component. One containment layer: the panel sits on the dialog's own
   surface, and the preview is the only bordered box inside it. Motion 150 ms ease-out on opacity
   and transform only. */

/* Excel's dialog is wider than a confirm: two columns side by side. */
.lp-dialog:has(.sheet-format-cells) {
  width: min(560px, calc(100vw - 32px));
}

.lp-dialog-body:has(.sheet-format-cells) {
  color: var(--lp-ink);
}

.sheet-format-cells {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  font-size: var(--lp-fs-sm);
}

/* -- the tab strip ------------------------------------------------------------------------- */
.sheet-format-cells-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--lp-line);
}

.sheet-format-cells-tab {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--lp-muted);
  cursor: pointer;
  padding: 6px 12px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease-out;
}

.sheet-format-cells-tab:hover {
  color: var(--lp-ink);
}

.sheet-format-cells-tab.is-on {
  color: var(--lp-ink);
  font-weight: 600;
  border-bottom-color: var(--lp-primary);
}

.sheet-format-cells-tab:focus-visible,
.sheet-format-cells-option:focus-visible,
.sheet-format-cells-swatch:focus-visible,
.sheet-format-cells-preset:focus-visible,
.sheet-format-cells-edge:focus-visible {
  outline: 2px solid var(--lp-primary);
  outline-offset: 1px;
}

/* Both panels share ONE grid cell, so the dialog is as tall as the taller tab and does not jump
   when the tab changes. The inactive panel keeps its `hidden` attribute (out of the tab order and
   the accessibility tree through `visibility`), it only keeps its box. */
.sheet-format-cells-panels {
  display: grid;
}

.sheet-format-cells-panel {
  grid-area: 1 / 1;
  min-width: 0;
}

.sheet-format-cells-panel[hidden] {
  display: block;
  visibility: hidden;
}

.sheet-format-cells-panel:not([hidden]) {
  animation: sheet-format-cells-in 150ms ease-out;
}

@keyframes sheet-format-cells-in {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sheet-format-cells-panel:not([hidden]) {
    animation: none;
  }
}

/* -- shared column anatomy ----------------------------------------------------------------- */
.sheet-format-cells-number,
.sheet-format-cells-border {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 16px;
}

.sheet-format-cells-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sheet-format-cells-heading {
  font-weight: 600;
  color: var(--lp-ink);
}

.sheet-format-cells-sub {
  font-size: var(--lp-fs-2xs);
  color: var(--lp-muted);
}

.sheet-format-cells-note {
  margin: 0;
  font-size: var(--lp-fs-2xs);
  line-height: var(--lp-lh);
  color: var(--lp-muted);
}

/* A list is rows in a hairline box, not cards. */
.sheet-format-cells-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-md);
  padding: 2px;
}

.sheet-format-cells-option,
.sheet-format-cells-swatch,
.sheet-format-cells-preset,
.sheet-format-cells-edge {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.sheet-format-cells-option {
  text-align: left;
  padding: 5px 8px;
  border-radius: var(--lp-r-sm);
  transition: background-color 150ms ease-out;
}

.sheet-format-cells-option:hover {
  background: var(--lp-surface-2);
}

.sheet-format-cells-option.is-on {
  background: var(--lp-primary-tint);
  color: var(--lp-ink);
}

/* -- Number tab ---------------------------------------------------------------------------- */
.sheet-format-cells-sample {
  display: block;
  padding: 6px 8px;
  border-bottom: 1px solid var(--lp-line);
  font-variant-numeric: tabular-nums;
  color: var(--lp-ink);
  min-height: 1.5em;
}

.sheet-format-cells-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sheet-format-cells-input {
  width: 64px;
  padding: 4px 6px;
  font: inherit;
  color: var(--lp-ink);
  background: var(--lp-surface);
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-sm);
}

.sheet-format-cells-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* -- Border tab ---------------------------------------------------------------------------- */
.sheet-format-cells-style {
  display: flex;
  align-items: center;
  padding-top: 7px;
  padding-bottom: 7px;
}

.sheet-format-cells-swatches {
  display: grid;
  grid-template-columns: repeat(6, 22px);
  gap: 4px;
}

.sheet-format-cells-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: var(--lp-r-sm);
}

.sheet-format-cells-swatch.is-on {
  box-shadow: inset 0 0 0 2px var(--lp-primary);
}

.sheet-format-cells-chip {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px var(--lp-line);
}

.sheet-format-cells-custom {
  cursor: pointer;
}

.sheet-format-cells-color {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-sm);
  background: transparent;
  cursor: pointer;
}

.sheet-format-cells-presets {
  display: flex;
  gap: 16px;
}

.sheet-format-cells-preset {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: var(--lp-r-md);
  font-size: var(--lp-fs-2xs);
  transition: background-color 150ms ease-out;
}

.sheet-format-cells-preset:hover,
.sheet-format-cells-edge:hover {
  background: var(--lp-surface-2);
}

.sheet-format-cells-preset .sheet-ribbon-icon {
  width: 24px;
  height: 24px;
  color: var(--lp-ink);
}

/* The preview board: edge buttons down the left, the 2 by 2 block, edge buttons underneath. */
.sheet-format-cells-board {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 6px;
  align-items: stretch;
}

.sheet-format-cells-edges {
  display: flex;
  gap: 4px;
}

.sheet-format-cells-edges.is-rows {
  grid-column: 1;
  grid-row: 1;
  flex-direction: column;
  justify-content: space-between;
}

.sheet-format-cells-edges.is-cols {
  grid-column: 2;
  grid-row: 2;
  justify-content: space-between;
}

.sheet-format-cells-edge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--lp-r-sm);
  box-shadow: inset 0 0 0 1px var(--lp-line);
  color: var(--lp-ink);
  transition: background-color 150ms ease-out;
}

.sheet-format-cells-edge.is-set {
  background: var(--lp-primary-tint);
  box-shadow: inset 0 0 0 1px var(--lp-primary);
}

.sheet-format-cells-edge.is-cleared {
  color: var(--lp-muted);
}

.sheet-format-cells-preview {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: auto;
  border: 1px solid var(--lp-line);
  border-radius: var(--lp-r-md);
  background: var(--lp-surface);
}

.sheet-format-cells-guide {
  fill: none;
  stroke: var(--lp-line-strong);
  stroke-width: 1;
  stroke-dasharray: 1 3;
}

.sheet-format-cells-guide.is-cleared {
  stroke: var(--lp-line);
}

.sheet-format-cells-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 12;
  pointer-events: stroke;
  cursor: pointer;
}