documentation/components/source/example.css

1:host {
2  display: block;
3  color: var(--color-text, #26332c);
4  font: inherit;
5  margin: 1.5rem 0 2rem;
6  --ink: var(--color-link, #386d98);
7  --line: var(--color-accent, #dce3db);
8  --axiomatic-cue-color: var(--line);
9  --paper: var(--color-background, #fff);
10  --quiet: var(--color-text-aside, #64706a);
11}
12* {
13  box-sizing: border-box;
14}
15p,
16h3,
17pre {
18  margin: 0;
19}
20button,
21input {
22  font: inherit;
23}
24button {
25  color: inherit;
26}
27button:focus-visible,
28input:focus-visible,
29summary:focus-visible,
30[role="slider"]:focus-visible {
31  outline: 2px solid var(--ink);
32  outline-offset: 3px;
33}
34button {
35  border: 0;
36  background: none;
37  cursor: pointer;
38}
39.stage {
40  position: relative;
41  padding-inline-end: 24px;
42}
43.viewport {
44  anchor-scope: --axiomatic-resize-handle;
45  position: relative;
46  max-inline-size: 100%;
47  inline-size: 600px;
48}
49.bar {
50  display: flex;
51  flex-wrap: wrap;
52  align-items: center;
53  justify-content: space-between;
54  gap: 8px;
55  min-block-size: 32px;
56  color: var(--quiet);
57  font-size: 11px;
58}
59.bar button {
60  padding: 4px 0;
61  white-space: nowrap;
62}
63.bar button[aria-pressed="true"] {
64  color: var(--ink);
65}
66.tools {
67  display: flex;
68  align-items: center;
69  gap: 12px;
70}
71.width {
72  display: flex;
73  align-items: baseline;
74  gap: 3px;
75  font-variant-numeric: tabular-nums;
76}
77.width input {
78  field-sizing: content;
79  inline-size: 4ch;
80  min-inline-size: 3ch;
81  max-inline-size: 5ch;
82  border: 0;
83  border-bottom: 1px solid transparent;
84  background: transparent;
85  color: inherit;
86  text-align: end;
87  padding: 3px 0;
88  appearance: textfield;
89}
90.width input:hover,
91.width input:focus {
92  border-bottom-color: var(--line);
93}
94.width input::-webkit-inner-spin-button {
95  appearance: none;
96}
97.frame {
98  position: relative;
99  padding: 20px;
100  border: 1px solid var(--line);
101  border-radius: 4px;
102  background: var(--paper);
103}
104.resize {
105  anchor-name: --axiomatic-resize-handle;
106  position: absolute;
107  inset-inline-end: -30px;
108  inset-block-start: 0;
109  inset-block-end: 0;
110  inline-size: 44px;
111  display: grid;
112  place-items: center;
113  cursor: ew-resize;
114  touch-action: none;
115  border: 0;
116  background: none;
117  border-radius: 3px;
118  color: var(--quiet);
119}
120.resize::after {
121  content: "";
122  position: absolute;
123  inset-block-start: var(--grip-y, 50%);
124  transform: translateY(-50%);
125  inline-size: 5px;
126  block-size: 28px;
127  border-inline: 1px solid currentColor;
128  opacity: 0.55;
129}
130/* Keep the grip under the pointer while linked examples above it reflow. */
131.resize[data-dragging="true"]::after {
132  position: fixed;
133  top: var(--grip-y);
134  left: anchor(--axiomatic-resize-handle center);
135  transform: translate(-50%, -50%);
136}
137.resize:hover::after,
138.resize:focus-visible::after {
139  opacity: 1;
140  color: var(--ink);
141}
142[data-axiomatic="Meta"] {
143  color: var(--quiet);
144}
145.caption {
146  display: flex;
147  flex-wrap: wrap;
148  align-items: baseline;
149  gap: 12px;
150  margin-block-start: 7px;
151  min-block-size: 18px;
152  font-size: 11px;
153  line-height: 1.5;
154  color: var(--quiet);
155}
156.selection {
157  color: var(--ink);
158}
159.selection:empty {
160  display: none;
161}
162:host([edits="composition"]) .caption {
163  min-block-size: 2lh;
164}
165/* One readout: the selected item, or the overall result. Reserve two lines
166   so selecting a code name doesn't shift its neighboring click targets. */
167:host([edits="composition"]) .caption:has(.selection:not(:empty)) .note {
168  display: none;
169}
170.note:empty {
171  display: none;
172}
173pre {
174  white-space: pre-wrap;
175  overflow-wrap: anywhere;
176  font:
177    12px/1.7 ui-monospace,
178    SFMono-Regular,
179    monospace;
180  background: var(--color-background-secondary, #f4f6f2);
181  padding: 14px 16px;
182  border-radius: 4px;
183  margin-block-start: 10px;
184  tab-size: 2;
185}
186/* Structural lines come from the printer. Soft-wrapped strings keep a
187   continuation indent, while the first visual line retains its source indent. */
188.code-line {
189  display: block;
190  padding-inline-start: var(--continuation);
191  text-indent: calc(-1 * var(--continuation));
192}
193.token {
194  color: light-dark(var(--shiki-light), var(--shiki-dark));
195}
196.code-name {
197  font: inherit;
198  line-height: inherit;
199  padding: 0;
200  vertical-align: baseline;
201  cursor: default;
202}
203.inspecting .code-name {
204  cursor: pointer;
205}
206.code-line[data-selected="true"],
207.token[data-selected="true"] {
208  background: color-mix(in srgb, var(--ink) 10%, transparent);
209  border-radius: 2px;
210}
211.inspecting .code-name:hover {
212  text-decoration: underline;
213  text-underline-offset: 3px;
214}
215.edit {
216  display: flex;
217  flex-wrap: wrap;
218  align-items: baseline;
219  gap: 6px 12px;
220  font-size: 12px;
221  margin-block-start: 10px;
222  color: var(--quiet);
223}
224.edit input {
225  flex: 1;
226  min-inline-size: 160px;
227  max-inline-size: 100%;
228  padding: 4px 0;
229  border: 0;
230  border-bottom: 1px solid var(--line);
231  background: none;
232  color: var(--color-text);
233  border-radius: 0;
234}
235.sr-only {
236  position: absolute;
237  inline-size: 1px;
238  block-size: 1px;
239  padding: 0;
240  margin: -1px;
241  overflow: hidden;
242  clip-path: inset(50%);
243  white-space: nowrap;
244  border: 0;
245}
246@media (forced-colors: active) {
247  .token {
248    color: CanvasText;
249  }
250  /* Selection remains visible when the system suppresses the subtree tint. */
251  .code-name[aria-pressed="true"] {
252    text-decoration: underline;
253    text-decoration-thickness: 2px;
254    text-underline-offset: 3px;
255  }
256  .resize {
257    color: ButtonText;
258  }
259}
260
261/* The authoring strip connects the picture to its declaration. */
262.authoring {
263  display: flex;
264  flex-wrap: wrap;
265  align-items: baseline;
266  gap: 6px 16px;
267  margin-block: 10px 4px;
268  font-size: 12px;
269}
270.authoring button {
271  padding: 6px 0;
272}
273.authoring .group-action,
274.authoring .ungroup-action {
275  color: var(--ink);
276  font-weight: 600;
277}
278.authoring [hidden] {
279  display: none;
280}
281.author-status {
282  flex: 1 1 220px;
283  color: var(--quiet);
284  line-height: 1.5;
285}
286.history {
287  display: flex;
288  gap: 16px;
289  margin-inline-start: auto;
290}
291.composition-actions {
292  display: flex;
293  flex-wrap: wrap;
294  gap: 6px 16px;
295}
296.combined .arrangement {
297  flex-basis: 100%;
298}
299/* Selecting adjacent code names must not move the next click target. */
300.combined .arrangement-label {
301  min-inline-size: 17em;
302}
303.combined .author-status {
304  min-block-size: 2lh;
305}
306.clear-action {
307  color: var(--quiet);
308}
309.authoring button:disabled {
310  color: var(--quiet);
311  opacity: 0.55;
312  cursor: default;
313}
314/* One native choice for the selected group. The status takes its own row
315   beneath, so the choice stays put while the status changes. */
316.arrangement {
317  display: flex;
318  flex-wrap: wrap;
319  align-items: center;
320  gap: 0 14px;
321}
322/* Keep the alternatives together when the label needs a separate line. */
323.arrangement-options {
324  display: inline-flex;
325  gap: 14px;
326}
327.arrangement-label {
328  color: var(--quiet);
329}
330.arrangement label {
331  display: inline-flex;
332  align-items: center;
333  gap: 5px;
334  padding: 6px 0;
335  cursor: pointer;
336}
337.arrangement input {
338  inline-size: 1em;
339  block-size: 1em;
340  margin: 0;
341  accent-color: var(--ink);
342}
343.arrangement label:has(:checked) {
344  color: var(--ink);
345}
346.arrangement label:has(:disabled) {
347  color: var(--quiet);
348  cursor: default;
349}
350.arrangement ~ .author-status {
351  order: 1;
352  flex-basis: 100%;
353}
354:host(.editable) .leaf,
355:host(.editable) .code-name {
356  cursor: pointer;
357}
358[data-chosen="true"].node,
359[data-chosen="true"].leaf {
360  background-image: linear-gradient(
361    color-mix(in srgb, var(--ink) 8%, transparent),
362    color-mix(in srgb, var(--ink) 8%, transparent)
363  );
364}
365.code-line[data-chosen="true"],
366.token[data-chosen="true"] {
367  background: color-mix(in srgb, var(--ink) 12%, transparent);
368}
369.code-line[data-chosen="true"] .token[data-chosen="true"] {
370  background: transparent;
371}
372@media (pointer: coarse) {
373  .authoring button,
374  .arrangement label {
375    min-block-size: 44px;
376  }
377}
378
379/* This native extent changes with Shelf members and gaps, even at fixed width.
380   It is invisible and contained within their existing scrollable span. */
381.rendered [data-kind="Shelf"] {
382  position: relative;
383}
384.overflow-extent {
385  position: absolute;
386  inset-block-start: 0;
387  block-size: 0;
388  inset-inline-start: anchor(var(--extent-first) start);
389  inset-inline-end: anchor(var(--extent-last) end);
390  visibility: hidden;
391  pointer-events: none;
392}
393
394/* Width-only observations do not subscribe to mode-dependent heights. */
395[data-observation="inline-size"] {
396  position: absolute;
397  inset-inline: 0;
398  inset-block-start: 0;
399  padding-inline: inherit;
400  visibility: hidden;
401  pointer-events: none;
402}
403[data-observation="inline-size"],
404[data-observation="inline-size"] > span {
405  display: block;
406  block-size: 0;
407}
408pre {
409  position: relative;
410}