@axiapps/axi-design 1.32.0 → 1.34.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/dist/axi.css +44 -6
- package/docs/RULES.md +20 -0
- package/package.json +1 -1
- package/src/primitives.css +42 -0
- package/src/prose.css +2 -6
package/dist/axi.css
CHANGED
|
@@ -371,6 +371,17 @@ button.axi-panel--tile:hover,
|
|
|
371
371
|
padding: var(--axi-well-pad, 10px);
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
+
/* The reading-scale well, which the comment above describes and this language
|
|
375
|
+
then made every consumer spell out by hand. Saying `--axi-radius-sm` inline
|
|
376
|
+
is fine for the handful of instances that comment imagined; the first real
|
|
377
|
+
consumer to be counted had fifty, and fifty inline style attributes is the
|
|
378
|
+
thing a class exists to prevent. The same argument produced .axi-btn--sm.
|
|
379
|
+
|
|
380
|
+
Only the radius, because that is the only thing that changes: a recess the
|
|
381
|
+
size of a single reading still holds objects that carry their own padding, so
|
|
382
|
+
the pad knob is still the right way to say anything else. */
|
|
383
|
+
.axi-well--sm { --axi-well-radius: var(--axi-radius-sm); }
|
|
384
|
+
|
|
374
385
|
/* ---------- button ---------- */
|
|
375
386
|
.axi-btn {
|
|
376
387
|
display: inline-flex; align-items: center; gap: 8px;
|
|
@@ -672,6 +683,37 @@ button.axi-panel--tile:hover,
|
|
|
672
683
|
color: var(--axi-accent); font-weight: 900; pointer-events: none;
|
|
673
684
|
}
|
|
674
685
|
|
|
686
|
+
/* ---------- code ---------- */
|
|
687
|
+
/* A literal the reader is meant to type or recognise character for character:
|
|
688
|
+
a slash command, a file extension, a URL, a config key. The language already
|
|
689
|
+
had this style, but only as `.axi-prose code` - reachable by adopting a whole
|
|
690
|
+
typography layer for a document. A consumer with one command to name inside a
|
|
691
|
+
sentence of interface copy cannot adopt that layer without restyling the
|
|
692
|
+
sentence, so it invents a box instead. One real consumer had three spellings
|
|
693
|
+
for six spans, and the sixth had given up and drawn no box at all.
|
|
694
|
+
|
|
695
|
+
So the rule below carries both selectors. Not for brevity - because a code
|
|
696
|
+
span inside rendered markdown and a code span inside a card are the same
|
|
697
|
+
object, and the last time this language spelled one object twice the two
|
|
698
|
+
copies drifted. There is a test that they stay one rule.
|
|
699
|
+
|
|
700
|
+
`em`, not `px`: this lands in body copy and in 10px captions alike, and a
|
|
701
|
+
literal that does not track the text around it reads as a different voice.
|
|
702
|
+
|
|
703
|
+
It sits on --axi-ground where .axi-kbd sits on --axi-surface, and the
|
|
704
|
+
reason is already written down one rule below: a key is raised off what it
|
|
705
|
+
is printed on, and a quoted literal is sunk into it. */
|
|
706
|
+
.axi-code,
|
|
707
|
+
.axi-prose code {
|
|
708
|
+
font-family: var(--axi-mono);
|
|
709
|
+
font-size: .88em;
|
|
710
|
+
background: var(--axi-ground);
|
|
711
|
+
color: var(--axi-text);
|
|
712
|
+
border: var(--axi-border-hairline) solid var(--axi-ink-line);
|
|
713
|
+
border-radius: var(--axi-radius-sm);
|
|
714
|
+
padding: 1px 5px;
|
|
715
|
+
}
|
|
716
|
+
|
|
675
717
|
/* ---------- keyboard key ---------- */
|
|
676
718
|
/* A key on the keyboard, named in the interface: the Esc that closes a
|
|
677
719
|
palette, the Ctrl K that opens it. Drawn as a small control rather than as a
|
|
@@ -2606,12 +2648,8 @@ textarea.axi-input {
|
|
|
2606
2648
|
border: var(--axi-border-hairline) solid var(--axi-ink-line);
|
|
2607
2649
|
}
|
|
2608
2650
|
|
|
2609
|
-
.axi-prose code
|
|
2610
|
-
|
|
2611
|
-
background: var(--axi-ground); color: var(--axi-text);
|
|
2612
|
-
border: var(--axi-border-hairline) solid var(--axi-ink-line);
|
|
2613
|
-
border-radius: var(--axi-radius-sm); padding: 1px 5px;
|
|
2614
|
-
}
|
|
2651
|
+
/* .axi-prose code is declared beside .axi-code in primitives.css: one rule,
|
|
2652
|
+
both selectors, because they are one object. */
|
|
2615
2653
|
.axi-prose pre {
|
|
2616
2654
|
margin: 0 0 18px; padding: 14px 16px; overflow-x: auto;
|
|
2617
2655
|
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
|
@@ -97,6 +97,17 @@ button.axi-panel--tile:hover,
|
|
|
97
97
|
padding: var(--axi-well-pad, 10px);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
/* The reading-scale well, which the comment above describes and this language
|
|
101
|
+
then made every consumer spell out by hand. Saying `--axi-radius-sm` inline
|
|
102
|
+
is fine for the handful of instances that comment imagined; the first real
|
|
103
|
+
consumer to be counted had fifty, and fifty inline style attributes is the
|
|
104
|
+
thing a class exists to prevent. The same argument produced .axi-btn--sm.
|
|
105
|
+
|
|
106
|
+
Only the radius, because that is the only thing that changes: a recess the
|
|
107
|
+
size of a single reading still holds objects that carry their own padding, so
|
|
108
|
+
the pad knob is still the right way to say anything else. */
|
|
109
|
+
.axi-well--sm { --axi-well-radius: var(--axi-radius-sm); }
|
|
110
|
+
|
|
100
111
|
/* ---------- button ---------- */
|
|
101
112
|
.axi-btn {
|
|
102
113
|
display: inline-flex; align-items: center; gap: 8px;
|
|
@@ -398,6 +409,37 @@ button.axi-panel--tile:hover,
|
|
|
398
409
|
color: var(--axi-accent); font-weight: 900; pointer-events: none;
|
|
399
410
|
}
|
|
400
411
|
|
|
412
|
+
/* ---------- code ---------- */
|
|
413
|
+
/* A literal the reader is meant to type or recognise character for character:
|
|
414
|
+
a slash command, a file extension, a URL, a config key. The language already
|
|
415
|
+
had this style, but only as `.axi-prose code` - reachable by adopting a whole
|
|
416
|
+
typography layer for a document. A consumer with one command to name inside a
|
|
417
|
+
sentence of interface copy cannot adopt that layer without restyling the
|
|
418
|
+
sentence, so it invents a box instead. One real consumer had three spellings
|
|
419
|
+
for six spans, and the sixth had given up and drawn no box at all.
|
|
420
|
+
|
|
421
|
+
So the rule below carries both selectors. Not for brevity - because a code
|
|
422
|
+
span inside rendered markdown and a code span inside a card are the same
|
|
423
|
+
object, and the last time this language spelled one object twice the two
|
|
424
|
+
copies drifted. There is a test that they stay one rule.
|
|
425
|
+
|
|
426
|
+
`em`, not `px`: this lands in body copy and in 10px captions alike, and a
|
|
427
|
+
literal that does not track the text around it reads as a different voice.
|
|
428
|
+
|
|
429
|
+
It sits on --axi-ground where .axi-kbd sits on --axi-surface, and the
|
|
430
|
+
reason is already written down one rule below: a key is raised off what it
|
|
431
|
+
is printed on, and a quoted literal is sunk into it. */
|
|
432
|
+
.axi-code,
|
|
433
|
+
.axi-prose code {
|
|
434
|
+
font-family: var(--axi-mono);
|
|
435
|
+
font-size: .88em;
|
|
436
|
+
background: var(--axi-ground);
|
|
437
|
+
color: var(--axi-text);
|
|
438
|
+
border: var(--axi-border-hairline) solid var(--axi-ink-line);
|
|
439
|
+
border-radius: var(--axi-radius-sm);
|
|
440
|
+
padding: 1px 5px;
|
|
441
|
+
}
|
|
442
|
+
|
|
401
443
|
/* ---------- keyboard key ---------- */
|
|
402
444
|
/* A key on the keyboard, named in the interface: the Esc that closes a
|
|
403
445
|
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);
|