@axiapps/axi-design 1.31.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/axi.css +45 -7
- package/docs/RULES.md +20 -0
- package/package.json +1 -1
- package/src/primitives.css +43 -1
- package/src/prose.css +2 -6
package/README.md
CHANGED
|
@@ -140,6 +140,8 @@ not "what does the system look like". Everything else is
|
|
|
140
140
|
| `--axi-textarea-h` | the minimum height of a `<textarea class="axi-input">` | `90px` | `<textarea class="axi-input" style="--axi-textarea-h: 200px">` |
|
|
141
141
|
| `--axi-btn-pad` | the padding inside an `.axi-btn`. The three named steps set it for you; reach for the knob only for a size they do not cover | `12px 20px` | `<button class="axi-btn" style="--axi-btn-pad: 3px 7px">` |
|
|
142
142
|
| `--axi-btn-size` | an `.axi-btn`'s text size, which travels with its padding | `13px` | `<button class="axi-btn" style="--axi-btn-size: 10px">` |
|
|
143
|
+
| `--axi-pill-pad` | the padding inside an `.axi-pill`. The same scale and the same two named steps as the button, because a pill is a button that holds a state | `12px 20px` | `<button class="axi-pill" style="--axi-pill-pad: 3px 7px">` |
|
|
144
|
+
| `--axi-pill-size` | an `.axi-pill`'s text size, which travels with its padding | `13px` | `<button class="axi-pill" style="--axi-pill-size: 10px">` |
|
|
143
145
|
| `--axi-input-pad` | the padding inside an `.axi-input`, for a field that is furniture in a header rather than a control on a page | `11px 12px` | `<input class="axi-input" style="--axi-input-pad: 7px 12px">` |
|
|
144
146
|
| `--axi-input-size` | an `.axi-input`'s text size, which travels with its padding | `14px` | `<input class="axi-input" style="--axi-input-size: 13px">` |
|
|
145
147
|
| `--axi-well-pad` | the padding inside an `.axi-well` | `10px` | `<div class="axi-well" style="--axi-well-pad: 18px">` |
|
package/dist/axi.css
CHANGED
|
@@ -448,19 +448,30 @@ button.axi-panel--tile:hover,
|
|
|
448
448
|
as a generic "selected". Consumers set that colour with --axi-pill-fill,
|
|
449
449
|
on the pill or on any ancestor - it is read through a fallback and never
|
|
450
450
|
declared on the component, which is what keeps both placements working. */
|
|
451
|
+
/* On the button's scale, and deliberately the same numbers. The only thing a
|
|
452
|
+
pill has that a button does not is a state, so two of them carrying the same
|
|
453
|
+
13px uppercase label have no reason to be different shapes - and they were:
|
|
454
|
+
measured at 12px/20px against 10px/9px, the pill's sides less than half the
|
|
455
|
+
button's, 43px tall against 39px. Side by side that reads as two components
|
|
456
|
+
rather than one component holding a state. The steps below are the button's
|
|
457
|
+
steps verbatim for the same reason, and a test holds the two in step. */
|
|
451
458
|
.axi-pill {
|
|
452
459
|
display: inline-flex; align-items: center; gap: 6px;
|
|
453
|
-
padding:
|
|
460
|
+
padding: var(--axi-pill-pad, 12px 20px);
|
|
454
461
|
border: var(--axi-border-control) solid var(--axi-ink-line);
|
|
455
462
|
border-radius: var(--axi-radius-sm);
|
|
456
463
|
background: var(--axi-ground);
|
|
457
464
|
color: var(--axi-text-dim);
|
|
458
465
|
font: var(--axi-t-label);
|
|
459
466
|
letter-spacing: var(--axi-ls-label);
|
|
467
|
+
/* After the `font` shorthand, which sets 13px and would otherwise reset it. */
|
|
468
|
+
font-size: var(--axi-pill-size, 13px);
|
|
460
469
|
text-transform: uppercase;
|
|
461
470
|
cursor: pointer;
|
|
462
471
|
transition: transform .1s, box-shadow .1s;
|
|
463
472
|
}
|
|
473
|
+
.axi-pill--sm { --axi-pill-pad: 8px 13px; --axi-pill-size: 12px; }
|
|
474
|
+
.axi-pill--xs { --axi-pill-pad: 5px 9px; --axi-pill-size: 11px; }
|
|
464
475
|
/* :where() for the same reason the button's hover has it - the brighten is
|
|
465
476
|
what a pill that has not been told its colour falls back to, not an override
|
|
466
477
|
of one that has. See rule 6's addendum. */
|
|
@@ -661,6 +672,37 @@ button.axi-panel--tile:hover,
|
|
|
661
672
|
color: var(--axi-accent); font-weight: 900; pointer-events: none;
|
|
662
673
|
}
|
|
663
674
|
|
|
675
|
+
/* ---------- code ---------- */
|
|
676
|
+
/* A literal the reader is meant to type or recognise character for character:
|
|
677
|
+
a slash command, a file extension, a URL, a config key. The language already
|
|
678
|
+
had this style, but only as `.axi-prose code` - reachable by adopting a whole
|
|
679
|
+
typography layer for a document. A consumer with one command to name inside a
|
|
680
|
+
sentence of interface copy cannot adopt that layer without restyling the
|
|
681
|
+
sentence, so it invents a box instead. One real consumer had three spellings
|
|
682
|
+
for six spans, and the sixth had given up and drawn no box at all.
|
|
683
|
+
|
|
684
|
+
So the rule below carries both selectors. Not for brevity - because a code
|
|
685
|
+
span inside rendered markdown and a code span inside a card are the same
|
|
686
|
+
object, and the last time this language spelled one object twice the two
|
|
687
|
+
copies drifted. There is a test that they stay one rule.
|
|
688
|
+
|
|
689
|
+
`em`, not `px`: this lands in body copy and in 10px captions alike, and a
|
|
690
|
+
literal that does not track the text around it reads as a different voice.
|
|
691
|
+
|
|
692
|
+
It sits on --axi-ground where .axi-kbd sits on --axi-surface, and the
|
|
693
|
+
reason is already written down one rule below: a key is raised off what it
|
|
694
|
+
is printed on, and a quoted literal is sunk into it. */
|
|
695
|
+
.axi-code,
|
|
696
|
+
.axi-prose code {
|
|
697
|
+
font-family: var(--axi-mono);
|
|
698
|
+
font-size: .88em;
|
|
699
|
+
background: var(--axi-ground);
|
|
700
|
+
color: var(--axi-text);
|
|
701
|
+
border: var(--axi-border-hairline) solid var(--axi-ink-line);
|
|
702
|
+
border-radius: var(--axi-radius-sm);
|
|
703
|
+
padding: 1px 5px;
|
|
704
|
+
}
|
|
705
|
+
|
|
664
706
|
/* ---------- keyboard key ---------- */
|
|
665
707
|
/* A key on the keyboard, named in the interface: the Esc that closes a
|
|
666
708
|
palette, the Ctrl K that opens it. Drawn as a small control rather than as a
|
|
@@ -2595,12 +2637,8 @@ textarea.axi-input {
|
|
|
2595
2637
|
border: var(--axi-border-hairline) solid var(--axi-ink-line);
|
|
2596
2638
|
}
|
|
2597
2639
|
|
|
2598
|
-
.axi-prose code
|
|
2599
|
-
|
|
2600
|
-
background: var(--axi-ground); color: var(--axi-text);
|
|
2601
|
-
border: var(--axi-border-hairline) solid var(--axi-ink-line);
|
|
2602
|
-
border-radius: var(--axi-radius-sm); padding: 1px 5px;
|
|
2603
|
-
}
|
|
2640
|
+
/* .axi-prose code is declared beside .axi-code in primitives.css: one rule,
|
|
2641
|
+
both selectors, because they are one object. */
|
|
2604
2642
|
.axi-prose pre {
|
|
2605
2643
|
margin: 0 0 18px; padding: 14px 16px; overflow-x: auto;
|
|
2606
2644
|
background: var(--axi-ground);
|
package/docs/RULES.md
CHANGED
|
@@ -682,3 +682,23 @@ vacuously while no theme exists, and binds the moment the first file lands.
|
|
|
682
682
|
4. Add it to the gallery, and check it with the accent switcher — if it does
|
|
683
683
|
not follow the accent, it hard-coded something.
|
|
684
684
|
5. `npm run build` and commit `dist/axi.css` with your source change.
|
|
685
|
+
|
|
686
|
+
### A style only reachable through a layer will be re-invented
|
|
687
|
+
|
|
688
|
+
If a style lives at `.some-layer .thing` and nowhere else, then it exists for
|
|
689
|
+
consumers who adopted that layer and for nobody else. Every other consumer that
|
|
690
|
+
needs the same object has to adopt a whole layer to reach one declaration — and
|
|
691
|
+
what it does instead is draw its own. That is not a hypothetical: `.axi-prose
|
|
692
|
+
code` was the language's only word for a quoted literal, and a consumer with six
|
|
693
|
+
literals in its interface copy — none of them in prose — had written three
|
|
694
|
+
different boxes for them, the sixth having given up and drawn none.
|
|
695
|
+
|
|
696
|
+
So when a layer-scoped style names an object that can appear outside that layer,
|
|
697
|
+
give the object its own class and put **both selectors on one rule**. Not two
|
|
698
|
+
rules that agree: one rule. `.axi-code, .axi-prose code { … }`. Two rules that
|
|
699
|
+
agree today are two rules that disagree after the next edit, and that is how the
|
|
700
|
+
same object ends up with two appearances inside one language — the defect this
|
|
701
|
+
whole section exists to prevent.
|
|
702
|
+
|
|
703
|
+
The test to write is not "does `.axi-code` exist". It is "are both spellings in
|
|
704
|
+
the same rule", because only the second one fails when someone splits them.
|
package/package.json
CHANGED
package/src/primitives.css
CHANGED
|
@@ -174,19 +174,30 @@ button.axi-panel--tile:hover,
|
|
|
174
174
|
as a generic "selected". Consumers set that colour with --axi-pill-fill,
|
|
175
175
|
on the pill or on any ancestor - it is read through a fallback and never
|
|
176
176
|
declared on the component, which is what keeps both placements working. */
|
|
177
|
+
/* On the button's scale, and deliberately the same numbers. The only thing a
|
|
178
|
+
pill has that a button does not is a state, so two of them carrying the same
|
|
179
|
+
13px uppercase label have no reason to be different shapes - and they were:
|
|
180
|
+
measured at 12px/20px against 10px/9px, the pill's sides less than half the
|
|
181
|
+
button's, 43px tall against 39px. Side by side that reads as two components
|
|
182
|
+
rather than one component holding a state. The steps below are the button's
|
|
183
|
+
steps verbatim for the same reason, and a test holds the two in step. */
|
|
177
184
|
.axi-pill {
|
|
178
185
|
display: inline-flex; align-items: center; gap: 6px;
|
|
179
|
-
padding:
|
|
186
|
+
padding: var(--axi-pill-pad, 12px 20px);
|
|
180
187
|
border: var(--axi-border-control) solid var(--axi-ink-line);
|
|
181
188
|
border-radius: var(--axi-radius-sm);
|
|
182
189
|
background: var(--axi-ground);
|
|
183
190
|
color: var(--axi-text-dim);
|
|
184
191
|
font: var(--axi-t-label);
|
|
185
192
|
letter-spacing: var(--axi-ls-label);
|
|
193
|
+
/* After the `font` shorthand, which sets 13px and would otherwise reset it. */
|
|
194
|
+
font-size: var(--axi-pill-size, 13px);
|
|
186
195
|
text-transform: uppercase;
|
|
187
196
|
cursor: pointer;
|
|
188
197
|
transition: transform .1s, box-shadow .1s;
|
|
189
198
|
}
|
|
199
|
+
.axi-pill--sm { --axi-pill-pad: 8px 13px; --axi-pill-size: 12px; }
|
|
200
|
+
.axi-pill--xs { --axi-pill-pad: 5px 9px; --axi-pill-size: 11px; }
|
|
190
201
|
/* :where() for the same reason the button's hover has it - the brighten is
|
|
191
202
|
what a pill that has not been told its colour falls back to, not an override
|
|
192
203
|
of one that has. See rule 6's addendum. */
|
|
@@ -387,6 +398,37 @@ button.axi-panel--tile:hover,
|
|
|
387
398
|
color: var(--axi-accent); font-weight: 900; pointer-events: none;
|
|
388
399
|
}
|
|
389
400
|
|
|
401
|
+
/* ---------- code ---------- */
|
|
402
|
+
/* A literal the reader is meant to type or recognise character for character:
|
|
403
|
+
a slash command, a file extension, a URL, a config key. The language already
|
|
404
|
+
had this style, but only as `.axi-prose code` - reachable by adopting a whole
|
|
405
|
+
typography layer for a document. A consumer with one command to name inside a
|
|
406
|
+
sentence of interface copy cannot adopt that layer without restyling the
|
|
407
|
+
sentence, so it invents a box instead. One real consumer had three spellings
|
|
408
|
+
for six spans, and the sixth had given up and drawn no box at all.
|
|
409
|
+
|
|
410
|
+
So the rule below carries both selectors. Not for brevity - because a code
|
|
411
|
+
span inside rendered markdown and a code span inside a card are the same
|
|
412
|
+
object, and the last time this language spelled one object twice the two
|
|
413
|
+
copies drifted. There is a test that they stay one rule.
|
|
414
|
+
|
|
415
|
+
`em`, not `px`: this lands in body copy and in 10px captions alike, and a
|
|
416
|
+
literal that does not track the text around it reads as a different voice.
|
|
417
|
+
|
|
418
|
+
It sits on --axi-ground where .axi-kbd sits on --axi-surface, and the
|
|
419
|
+
reason is already written down one rule below: a key is raised off what it
|
|
420
|
+
is printed on, and a quoted literal is sunk into it. */
|
|
421
|
+
.axi-code,
|
|
422
|
+
.axi-prose code {
|
|
423
|
+
font-family: var(--axi-mono);
|
|
424
|
+
font-size: .88em;
|
|
425
|
+
background: var(--axi-ground);
|
|
426
|
+
color: var(--axi-text);
|
|
427
|
+
border: var(--axi-border-hairline) solid var(--axi-ink-line);
|
|
428
|
+
border-radius: var(--axi-radius-sm);
|
|
429
|
+
padding: 1px 5px;
|
|
430
|
+
}
|
|
431
|
+
|
|
390
432
|
/* ---------- keyboard key ---------- */
|
|
391
433
|
/* A key on the keyboard, named in the interface: the Esc that closes a
|
|
392
434
|
palette, the Ctrl K that opens it. Drawn as a small control rather than as a
|
package/src/prose.css
CHANGED
|
@@ -46,12 +46,8 @@
|
|
|
46
46
|
border: var(--axi-border-hairline) solid var(--axi-ink-line);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.axi-prose code
|
|
50
|
-
|
|
51
|
-
background: var(--axi-ground); color: var(--axi-text);
|
|
52
|
-
border: var(--axi-border-hairline) solid var(--axi-ink-line);
|
|
53
|
-
border-radius: var(--axi-radius-sm); padding: 1px 5px;
|
|
54
|
-
}
|
|
49
|
+
/* .axi-prose code is declared beside .axi-code in primitives.css: one rule,
|
|
50
|
+
both selectors, because they are one object. */
|
|
55
51
|
.axi-prose pre {
|
|
56
52
|
margin: 0 0 18px; padding: 14px 16px; overflow-x: auto;
|
|
57
53
|
background: var(--axi-ground);
|