@axiapps/axi-design 1.32.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/dist/axi.css CHANGED
@@ -672,6 +672,37 @@ button.axi-panel--tile:hover,
672
672
  color: var(--axi-accent); font-weight: 900; pointer-events: none;
673
673
  }
674
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
+
675
706
  /* ---------- keyboard key ---------- */
676
707
  /* A key on the keyboard, named in the interface: the Esc that closes a
677
708
  palette, the Ctrl K that opens it. Drawn as a small control rather than as a
@@ -2606,12 +2637,8 @@ textarea.axi-input {
2606
2637
  border: var(--axi-border-hairline) solid var(--axi-ink-line);
2607
2638
  }
2608
2639
 
2609
- .axi-prose code {
2610
- font-family: var(--axi-mono); font-size: .88em;
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
- }
2640
+ /* .axi-prose code is declared beside .axi-code in primitives.css: one rule,
2641
+ both selectors, because they are one object. */
2615
2642
  .axi-prose pre {
2616
2643
  margin: 0 0 18px; padding: 14px 16px; overflow-x: auto;
2617
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiapps/axi-design",
3
- "version": "1.32.0",
3
+ "version": "1.33.0",
4
4
  "description": "The design language for the axi suite — flat and outlined, dark, drawn in saturated ink.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -398,6 +398,37 @@ button.axi-panel--tile:hover,
398
398
  color: var(--axi-accent); font-weight: 900; pointer-events: none;
399
399
  }
400
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
+
401
432
  /* ---------- keyboard key ---------- */
402
433
  /* A key on the keyboard, named in the interface: the Esc that closes a
403
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
- font-family: var(--axi-mono); font-size: .88em;
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);