oficina / estilo Public

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

Plain git — no account needed to clone.

Download

Download this file

1/* desk/desk.css: the desk colour, the floating card, the inspector and
2 the segmented control. Values copied from Docs
3 internal/docs/views/show.html at Docs origin/main b45b7b2.
4 The app places the card ([estilo-card] sets no position); give it
5 position: fixed or absolute, because its backdrop layer is anchored
6 to it. */
7@property --estilo-desk {
8 syntax: "<color>";
9 inherits: true;
10 initial-value: #e3e7ee;
11}
12@property --estilo-desk-ink {
13 syntax: "<color>";
14 inherits: true;
15 initial-value: #586070;
16}
17:root {
18 --estilo-desk: light-dark(#e3e7ee, #0e1015);
19 --estilo-desk-ink: light-dark(#586070, #9aa1ad);
20 --estilo-inspector-inline-size: 248px; /* PUBLIC */
21 --estilo-inspector-inset: 12px; /* PUBLIC */
22}
23
24/* The card: glass with the line as its rim. Surface only. */
25[estilo-card] {
26 box-sizing: border-box;
27 padding: var(--rst-sp-3);
28 border: 1px solid transparent;
29 border-radius: 12px;
30 background:
31 linear-gradient(light-dark(rgb(255 255 255 / 0.92), rgb(32 35 43 / 0.92)) 0 0) padding-box,
32 linear-gradient(var(--rst-line) 0 0) border-box;
33 box-shadow:
34 inset 0 1px 0 light-dark(rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.06)),
35 0 2px 4px rgb(23 32 60 / 0.06),
36 0 10px 20px -8px light-dark(rgb(23 32 60 / 0.18), rgb(0 0 0 / 0.5)),
37 0 28px 56px -20px light-dark(rgb(23 32 60 / 0.28), rgb(0 0 0 / 0.7));
38}
39/* The blur is drawn by a layer behind the content, not by the card: a
40 backdrop-filter makes its element the containing block of every
41 fixed descendant. */
42[estilo-card]::before {
43 content: "";
44 position: absolute;
45 inset: 0;
46 z-index: -1;
47 border-radius: inherit;
48 -webkit-backdrop-filter: saturate(1.4) blur(14px);
49 backdrop-filter: saturate(1.4) blur(14px);
50 pointer-events: none;
51}
52
53[estilo-inspector] {
54 inline-size: var(--estilo-inspector-inline-size);
55 display: flex;
56 flex-direction: column;
57 gap: var(--rst-sp-3);
58 overflow-y: auto;
59 overscroll-behavior: contain;
60 font-size: 13px;
61}
62[estilo-inspector][data-state="closed"] { display: none; }
63
64[estilo-inspector-group] {
65 display: flex;
66 flex-wrap: wrap;
67 gap: var(--rst-sp-2) var(--rst-sp-1);
68 margin: 0;
69 padding: 0;
70 border: 0;
71}
72/* A group with nothing showing is not shown. */
73[estilo-inspector-group]:not(:has(> :not([estilo-inspector-label], [hidden]))) { display: none; }
74[estilo-inspector-label] {
75 display: block;
76 flex: 0 0 100%;
77 margin: 0;
78 color: var(--rst-text-muted);
79 font: 650 11px/14px var(--rst-font, system-ui), sans-serif;
80}
81
82/* Selects and fields */
83[estilo-inspector] select,
84[estilo-inspector] input:is([type="text"], [type="number"]) {
85 box-sizing: border-box;
86 min-inline-size: 0;
87 block-size: 28px;
88 padding-inline: var(--rst-sp-2);
89 border: 1px solid var(--rst-line);
90 border-radius: 8px;
91 background: var(--rst-surface);
92 color: var(--rst-text);
93 font-size: 13px;
94 font-weight: 500;
95 text-overflow: ellipsis;
96}
97
98/* The segmented control: a joined row of 28px segments. A segment is a
99 button (aria-pressed) or a label around a radio or checkbox. */
100[estilo-seg] {
101 display: flex;
102 flex: 1 1 100%;
103 min-inline-size: 0;
104}
105[estilo-seg-item] {
106 position: relative;
107 display: inline-flex;
108 align-items: center;
109 justify-content: center;
110 flex: 1 1 0;
111 box-sizing: border-box;
112 min-inline-size: 24px;
113 min-block-size: 28px;
114 block-size: 28px;
115 padding: 0;
116 border: 0;
117 border-radius: 0;
118 background: var(--rst-surface-2);
119 color: var(--rst-text);
120 font: inherit;
121 line-height: 1;
122 cursor: pointer;
123}
124[estilo-seg-item]:nth-child(1 of [estilo-seg-item]) {
125 border-start-start-radius: 8px;
126 border-end-start-radius: 8px;
127}
128[estilo-seg-item]:nth-last-child(1 of [estilo-seg-item]) {
129 border-start-end-radius: 8px;
130 border-end-end-radius: 8px;
131}
132/* A radio or checkbox inside a segment is the state, not a thing to see. */
133[estilo-seg-item] input {
134 position: absolute;
135 inset: 0;
136 margin: 0;
137 opacity: 0;
138 cursor: inherit;
139}
140[estilo-seg-item]:hover:not(:disabled) { background: var(--rst-line); }
141[estilo-seg-item] svg { inline-size: 18px; block-size: 18px; }
142[estilo-seg-item]:disabled { color: var(--rst-text-faint); cursor: default; }
143/* Selected: tint and a complete 1px ring, so colour is not the only
144 sign. A box-shadow costs no layout. */
145[estilo-seg-item][aria-pressed="true"],
146[estilo-seg-item]:has(input:checked) {
147 background: var(--rst-accent-soft);
148 color: var(--rst-accent);
149 font-weight: 700;
150 box-shadow: inset 0 0 0 1px color-mix(in oklab, currentColor 45%, transparent);
151}
152[estilo-seg-item]:focus-visible,
153[estilo-seg-item]:has(input:focus-visible) {
154 outline: 2px solid var(--rst-accent);
155 outline-offset: -2px;
156}
157/* Forced colours drop the tint and the ring (a box-shadow). Selection
158 and focus each get their own mark, so a segment that is both shows
159 both: selection is a 2px border (Highlight), focus is an outline
160 2px outside the segment, raised over its neighbours. */
161@media (forced-colors: active) {
162 [estilo-seg-item][aria-pressed="true"],
163 [estilo-seg-item]:has(input:checked) {
164 border: 2px solid Highlight;
165 }
166 [estilo-seg-item]:focus-visible,
167 [estilo-seg-item]:has(input:focus-visible) {
168 z-index: 1;
169 outline: 2px solid Highlight;
170 outline-offset: 2px;
171 }
172}
173