oficina / fichas Public

Clone
git clone https://amadan.net/oficina/fichas

Plain git — no account needed to clone.

Download

Download this file

1/* grid.css — editing in place (level-up §5): the table's cells and their
2 editors, the card beside the list, the card's quiet inputs, History,
3 the notices and the toast, and the phone's list of rows and sheet. */
4
5/* ---- The table. The name is a link to the card; every other cell is,
6 without script, a link to the edit form, and with script the grid's
7 cell (grid.js). */
8[fichas-grid] [fichas-title-cell] { text-align: start; font-weight: 600; }
9[fichas-title-link] { color: var(--rst-text); text-decoration: none; }
10[fichas-title-link]:hover { text-decoration: underline; }
11[fichas-cell-link] { display: block; color: inherit; text-decoration: none; min-block-size: 1.5em; }
12[fichas-cell-link]:hover { text-decoration: none; }
13[fichas-grid] td[data-field] { cursor: text; position: relative; }
14[fichas-grid] td[data-kind="enum"], [fichas-grid] td[data-kind="date"] { cursor: pointer; }
15[fichas-grid] td[data-field]:hover { background: var(--rst-row-tint-hover, var(--rst-surface-2)); }
16[fichas-grid][role="grid"] :is(td, th):focus-visible,
17[fichas-grid] [data-active] {
18 outline: 2px solid var(--rst-accent);
19 outline-offset: -2px;
20}
21[fichas-grid] tr[data-out-of-view] > * { opacity: 0.62; }
22[fichas-out-of-view] {
23 display: inline-flex;
24 align-items: center;
25 gap: var(--rst-sp-1);
26 margin-inline-start: var(--rst-sp-2);
27 font-size: var(--rst-fs-xs);
28 font-weight: 500;
29 color: var(--rst-text-muted);
30}
31[fichas-out-of-view] > .icon { inline-size: 12px; block-size: 12px; }
32
33/* The editor floats over its cell, at least as wide, so the table never
34 reflows under the person typing. */
35[fichas-editor] {
36 position: absolute;
37 inset: 0;
38 z-index: 3;
39 display: flex;
40 align-items: center;
41 min-inline-size: 100%;
42 background: var(--rst-surface);
43 box-shadow: 0 0 0 2px var(--rst-accent), 0 10px 24px -12px rgb(23 32 60 / 0.35);
44 border-radius: 2px;
45}
46[fichas-editor] input, [fichas-editor] select {
47 inline-size: 100%;
48 block-size: 100%;
49 min-block-size: 2.25rem;
50 border: 0;
51 padding: 0 var(--rst-sp-3);
52 font: inherit;
53 font-size: max(16px, 1em);
54 color: var(--rst-text);
55 background: transparent;
56 box-sizing: border-box;
57}
58[fichas-editor] input:focus, [fichas-editor] select:focus { outline: none; }
59[fichas-editor-error] {
60 position: absolute;
61 inset-block-start: calc(100% + 4px);
62 inset-inline-start: 0;
63 z-index: 4;
64 min-inline-size: 14rem;
65 padding: var(--rst-sp-2) var(--rst-sp-3);
66 border-radius: 8px;
67 background: var(--rst-tone-negative-bg);
68 color: var(--rst-tone-negative-fg);
69 font-size: var(--rst-fs-sm);
70 box-shadow: var(--rst-shadow-pop, 0 8px 20px -8px rgb(0 0 0 / 0.3));
71}
72[fichas-editor-error] button { margin-inline-start: var(--rst-sp-2); }
73
74/* A choice's picker: a listbox with a search box (§6.5). */
75[fichas-picker] {
76 position: absolute;
77 inset-block-start: calc(100% + 4px);
78 inset-inline-start: 0;
79 z-index: 4;
80 min-inline-size: 14rem;
81 max-block-size: 18rem;
82 overflow: auto;
83 padding: var(--rst-sp-1);
84 border-radius: 12px;
85 background: var(--rst-surface);
86 box-shadow: 0 0 0 1px var(--rst-line), var(--rst-shadow-pop, 0 14px 30px -12px rgb(0 0 0 / 0.35));
87}
88[fichas-picker] input { inline-size: 100%; box-sizing: border-box; padding: var(--rst-sp-1) var(--rst-sp-2); border: 1px solid var(--rst-line); border-radius: 8px; font: inherit; font-size: max(16px, 1em); margin-block-end: var(--rst-sp-1); background: var(--rst-surface); color: var(--rst-text); }
89[fichas-picker] [role="listbox"] { list-style: none; margin: 0; padding: 0; }
90[fichas-picker] [role="option"] { padding: var(--rst-sp-1) var(--rst-sp-2); border-radius: 8px; cursor: pointer; min-block-size: 32px; display: flex; align-items: center; }
91[fichas-picker] [role="option"][aria-selected="true"] { background: var(--rst-accent-soft); }
92[fichas-picker] [role="option"][data-current]::after { content: "✓"; margin-inline-start: auto; color: var(--rst-accent); }
93
94/* ---- The card beside the list (§5.4). */
95[fichas-split-view] {
96 display: grid;
97 grid-template-columns: 288px minmax(0, 1fr);
98 gap: 0;
99 margin-inline: calc(-1 * var(--rst-sp-4));
100 min-block-size: calc(100dvh - 56px);
101}
102/* Flush under the bar on a wide screen: the page's own block-start
103 padding taken back, when nothing (no notice) sits above the split. The
104 split is a child of the page's stack, so this outranks the stack's
105 margin rule. */
106@media (min-width: 800px) {
107 [rst-page] > h1:first-child + [fichas-split-view] { margin-block-start: calc(-1 * var(--rst-sp-5)); }
108}
109[fichas-narrow] { border-inline-end: 1px solid var(--rst-line); min-inline-size: 0; }
110[fichas-narrow-head] {
111 display: flex;
112 align-items: center;
113 gap: var(--rst-sp-2);
114 padding: var(--rst-sp-3) var(--rst-sp-4);
115 border-block-end: 1px solid var(--rst-line);
116 font-weight: 600;
117 position: sticky;
118 inset-block-start: 56px;
119 background: var(--rst-bg);
120 z-index: 1;
121}
122[fichas-narrow-back] { display: inline-flex; color: var(--rst-text-muted); min-inline-size: 28px; min-block-size: 28px; align-items: center; justify-content: center; border-radius: 6px; }
123[fichas-narrow-back]:hover { background: var(--rst-surface-2); color: var(--rst-text); }
124[fichas-narrow-name] { flex: 1; }
125[fichas-narrow-count] { color: var(--rst-text-muted); font-weight: 500; font-variant-numeric: tabular-nums; }
126[fichas-narrow-list] { list-style: none; margin: 0; padding: 0; }
127[fichas-narrow-list] a {
128 display: grid;
129 gap: var(--rst-sp-1);
130 padding: var(--rst-sp-3) var(--rst-sp-4);
131 border-block-end: 1px solid var(--rst-line);
132 border-inline-start: 3px solid transparent;
133 color: var(--rst-text);
134 text-decoration: none;
135}
136[fichas-narrow-list] a:hover { background: var(--rst-surface-2); }
137[fichas-narrow-list] a[aria-current] { background: var(--rst-accent-soft); border-inline-start-color: var(--rst-accent); }
138[fichas-narrow-face] { display: flex; align-items: center; gap: var(--rst-sp-2); font-size: var(--rst-fs-sm); }
139[fichas-pane] { padding: var(--rst-sp-5) var(--rst-sp-5) var(--rst-sp-6); min-inline-size: 0; }
140[fichas-full-card] { max-inline-size: 64rem; }
141
142[fichas-card-top] { display: flex; align-items: center; gap: var(--rst-sp-2); flex-wrap: wrap; }
143[fichas-card-steps] { display: flex; align-items: center; gap: var(--rst-sp-2); margin-inline-end: auto; }
144[fichas-card-close] { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 36px; min-block-size: 36px; border-radius: 999px; color: var(--rst-text-muted); }
145[fichas-card-close]:hover { background: var(--rst-surface-2); color: var(--rst-text); }
146[fichas-card-meta] { display: flex; flex-wrap: wrap; gap: var(--rst-sp-1) var(--rst-sp-4); color: var(--rst-text-muted); font-size: var(--rst-fs-sm); padding-block-end: var(--rst-sp-3); border-block-end: 1px solid var(--rst-line); }
147[fichas-not-in-view] { display: inline-flex; align-items: center; gap: var(--rst-sp-1); }
148[fichas-not-in-view] > .icon { inline-size: 14px; block-size: 14px; }
149[fichas-card-fields] { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--rst-sp-3) var(--rst-sp-5); }
150/* The card's form is a stack, which spaces its blocks; it and its title
151 are also grid.js's hooks. The form never widens the card past the
152 pane, and the title has no margin of its own, in a stack or out. */
153[fichas-card-form] { min-inline-size: 0; }
154[fichas-card-heading] { margin: 0; }
155[fichas-card-long] { display: grid; }
156[fichas-card-save] { justify-content: flex-end; }
157/* With script each field saves on its own, so the form's button goes. */
158[data-fichas-live] [fichas-card-save] { display: none; }
159[fichas-card-log] { max-inline-size: 44rem; }
160[fichas-card-log] h3 { font-size: var(--rst-fs-lg); }
161
162/* Quiet inputs: a field that reads as text until it is touched (§5.1). */
163[fichas-quiet-field] { display: grid; gap: var(--rst-sp-1); min-inline-size: 0; }
164[fichas-quiet-label] { font-size: var(--rst-fs-sm); font-weight: 600; color: var(--rst-text-muted); }
165[fichas-quiet] {
166 inline-size: 100%;
167 box-sizing: border-box;
168 min-block-size: 36px;
169 padding: var(--rst-sp-1) var(--rst-sp-2);
170 /* the padding taken back, so the value's text sits under its label */
171 margin-inline: calc(-1 * var(--rst-sp-2));
172 border: 1px solid transparent;
173 border-radius: 8px;
174 background: transparent;
175 color: var(--rst-text);
176 font: inherit;
177 font-size: max(16px, 1em);
178}
179textarea[fichas-quiet] { resize: vertical; line-height: 1.5; }
180[fichas-quiet]:hover { border-color: var(--rst-line); }
181[fichas-quiet]:focus { outline: none; border-color: var(--rst-accent); box-shadow: 0 0 0 3px var(--rst-accent-soft); background: var(--rst-surface); }
182[fichas-quiet][aria-invalid="true"] { border-color: var(--rst-tone-negative-fg); }
183[fichas-quiet-field]:has([fichas-quiet-open]) { grid-template-columns: minmax(0, 1fr) auto; }
184[fichas-quiet-field]:has([fichas-quiet-open]) > [fichas-quiet-label] { grid-column: 1 / -1; }
185[fichas-quiet-open] { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 36px; min-block-size: 36px; border-radius: 8px; color: var(--rst-text-muted); }
186[fichas-quiet-open]:hover { background: var(--rst-surface-2); color: var(--rst-accent); }
187[fichas-quiet-open] > .icon { inline-size: 15px; block-size: 15px; }
188[fichas-card-view] { display: block; }
189[fichas-live] { position: absolute; }
190[fichas-quiet-title] { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: -0.01em; }
191[fichas-quiet-field][data-saving] [fichas-quiet] { border-color: var(--rst-line); }
192
193/* ---- Notices and the toast. */
194[fichas-notice] {
195 display: flex;
196 align-items: center;
197 gap: var(--rst-sp-3);
198 padding: var(--rst-sp-2) var(--rst-sp-3);
199 border-radius: 10px;
200 background: var(--rst-surface-2);
201 font-size: var(--rst-fs-sm);
202}
203[fichas-notice] form { display: contents; }
204[fichas-notice="refused"], [fichas-notice="conflict"] { background: var(--rst-tone-warning-bg); color: var(--rst-tone-warning-fg); }
205[fichas-toasts] {
206 position: fixed;
207 inset-block-end: 20px;
208 inset-inline: 0;
209 display: grid;
210 justify-items: center;
211 gap: var(--rst-sp-2);
212 pointer-events: none;
213 z-index: 40;
214}
215[fichas-toast] {
216 pointer-events: auto;
217 display: flex;
218 align-items: center;
219 gap: var(--rst-sp-3);
220 max-inline-size: min(36rem, calc(100vw - 32px));
221 padding: var(--rst-sp-2) var(--rst-sp-3) var(--rst-sp-2) var(--rst-sp-4);
222 border-radius: 12px;
223 background: var(--rst-text);
224 color: var(--rst-bg);
225 font-size: var(--rst-fs-sm);
226 box-shadow: 0 16px 34px -14px rgb(0 0 0 / 0.5);
227}
228[fichas-toast] button {
229 border: 0;
230 border-radius: 8px;
231 padding: var(--rst-sp-1) var(--rst-sp-2);
232 min-block-size: 32px;
233 background: color-mix(in srgb, var(--rst-bg) 16%, transparent);
234 color: inherit;
235 font: inherit;
236 font-weight: 600;
237 cursor: pointer;
238}
239
240/* ---- History (§5.5), the edit form's conflicts, and page heads. */
241[fichas-page-head] h1 { margin: 0 0 var(--rst-sp-1); }
242[fichas-page-head] a { display: inline-flex; align-items: center; gap: var(--rst-sp-1); color: var(--rst-text-muted); }
243[fichas-history] { list-style: none; margin: 0; padding: 0; display: grid; max-inline-size: 48rem; }
244[fichas-history-item] { padding-block: var(--rst-sp-3); border-block-end: 1px solid var(--rst-line); display: grid; gap: var(--rst-sp-2); }
245[fichas-history-head] { margin: 0; }
246[fichas-history-head] time { color: var(--rst-text-muted); margin-inline-start: var(--rst-sp-1); font-size: var(--rst-fs-sm); }
247[fichas-history-values] { display: grid; grid-template-columns: minmax(6rem, auto) 1fr; gap: var(--rst-sp-2) var(--rst-sp-4); margin: 0; font-size: var(--rst-fs-sm); }
248[fichas-history-values] dt { color: var(--rst-text-muted); font-weight: 600; }
249[fichas-history-values] dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--rst-sp-1) var(--rst-sp-2); }
250[fichas-history-before] { text-decoration: line-through; color: var(--rst-text-muted); }
251[fichas-history-after] { font-weight: 600; }
252[fichas-restore] { display: inline; }
253[fichas-conflict] { border: 1px solid var(--rst-line); border-radius: 12px; padding: var(--rst-sp-3) var(--rst-sp-4); margin: 0; display: grid; gap: var(--rst-sp-2); }
254[fichas-conflict] legend { font-weight: 600; padding-inline: var(--rst-sp-1); }
255[fichas-conflict-choice] { display: flex; align-items: center; gap: var(--rst-sp-2); min-block-size: 32px; }
256
257/* ---- Phones (§5.8): the table is a list of rows; a card is its own
258 screen with ‹ ›; a value opens a sheet. Inputs are at least 16px, so
259 iOS does not zoom, and every target at least 44px. */
260@media (max-width: 799.98px) {
261 [fichas-grid-wrap] { border-radius: 0; box-shadow: none; overflow: visible; }
262 [fichas-grid], [fichas-grid] tbody { display: block; }
263 [fichas-grid] thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
264 [fichas-grid] tr {
265 display: grid;
266 grid-template-columns: auto minmax(0, 1fr) auto;
267 align-items: center;
268 column-gap: var(--rst-sp-4);
269 padding: var(--rst-sp-1);
270 border-block-end: 1px solid var(--rst-line);
271 }
272 [fichas-grid] :is(th, td) { display: none; padding: 0; border: 0; background: none; }
273 [fichas-grid] [fichas-title-cell] { display: block; grid-column: 1 / 3; grid-row: 1; }
274 [fichas-grid] [fichas-title-link] { display: flex; align-items: center; min-block-size: 44px; font-size: 1.05rem; }
275 /* the status pill, then the next two values on one line */
276 [fichas-grid] td[data-kind="enum"] { display: block; grid-column: 3; grid-row: 1; justify-self: end; }
277 [fichas-grid] td[data-field]:not([data-kind="enum"]):nth-child(-n+3) { display: block; grid-row: 2; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); }
278 [fichas-grid] [fichas-cell-link] { display: flex; align-items: center; min-block-size: 44px; }
279 [fichas-grid-help] { padding-inline: var(--rst-sp-1); }
280
281 [fichas-split-view] { display: block; margin: 0; }
282 [fichas-narrow] { display: none; }
283 [fichas-pane] { padding: var(--rst-sp-1) 0 var(--rst-sp-6); }
284 [fichas-card-fields] { grid-template-columns: 1fr; }
285 [fichas-card-top] [rst-btn] { min-block-size: 44px; }
286 [fichas-card-steps] [fichas-meta] { display: none; }
287 [fichas-card-close] { min-inline-size: 44px; min-block-size: 44px; }
288}
289
290/* The phone's edit sheet: a field's editor at the foot of the screen,
291 Save at its foot (§5.8). A modal <dialog>, so focus stays in it. */
292[fichas-sheet] {
293 margin: auto 0 0;
294 inline-size: 100%;
295 max-inline-size: 100%;
296 box-sizing: border-box;
297 border: 0;
298 border-radius: 18px 18px 0 0;
299 padding: var(--rst-sp-4) var(--rst-sp-4) calc(var(--rst-sp-4) + env(safe-area-inset-bottom));
300 background: var(--rst-surface);
301 color: var(--rst-text);
302 box-shadow: 0 -18px 40px -18px rgb(0 0 0 / 0.4);
303}
304[fichas-sheet]::backdrop { background: rgb(15 20 30 / 0.35); }
305[fichas-sheet] form { display: grid; gap: var(--rst-sp-3); }
306[fichas-sheet] label { font-weight: 600; }
307[fichas-sheet] :is(input, select) { min-block-size: 44px; font-size: 16px; padding: 0 var(--rst-sp-3); border: 1px solid var(--rst-line); border-radius: 10px; background: var(--rst-surface); color: var(--rst-text); font-family: inherit; }
308[fichas-sheet-foot] { display: flex; justify-content: flex-end; gap: var(--rst-sp-2); }
309[fichas-sheet-foot] button { min-block-size: 44px; }
310[fichas-sheet-error] { color: var(--rst-tone-negative-fg); margin: 0; font-size: var(--rst-fs-sm); }
311