@axiapps/axi-design 1.35.0 → 1.36.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 +46 -4
- package/docs/RULES.md +14 -0
- package/package.json +1 -1
- package/src/primitives.css +43 -0
- package/src/prose.css +3 -4
package/dist/axi.css
CHANGED
|
@@ -743,6 +743,49 @@ button.axi-panel--tile:hover,
|
|
|
743
743
|
padding: 1px 5px;
|
|
744
744
|
}
|
|
745
745
|
|
|
746
|
+
/* ---------- link ---------- */
|
|
747
|
+
/* The same trap .axi-code was pulled out of, one component later. `.axi-prose
|
|
748
|
+
a` was the language's only word for a link, and it is reachable only by
|
|
749
|
+
adopting a whole typography layer - so a consumer with a "learn more" beside
|
|
750
|
+
a setting, or a docs URL in a modal footer, writes its own. One real consumer
|
|
751
|
+
had fifteen of them, hand-spelled, and a third of those were <button>s
|
|
752
|
+
calling an openExternal bridge rather than anchors at all.
|
|
753
|
+
|
|
754
|
+
Both selectors, one rule, for the reason written at .axi-code: a link in
|
|
755
|
+
rendered markdown and a link in interface copy are the same object, and the
|
|
756
|
+
last time this language spelled one object twice the two copies drifted.
|
|
757
|
+
There is a test that they stay one rule.
|
|
758
|
+
|
|
759
|
+
The underline is stated rather than inherited. An <a href> draws one by
|
|
760
|
+
default and a <button> does not, so leaving it to the user agent is exactly
|
|
761
|
+
how the two spellings would come apart - the declaration is a no-op on the
|
|
762
|
+
anchor and load-bearing on the button. Same for the background, border and
|
|
763
|
+
padding resets: they say nothing about an anchor and are the whole reason a
|
|
764
|
+
button can wear this class.
|
|
765
|
+
|
|
766
|
+
`font-family` and `font-size` inherit, but the weight does not: a link is
|
|
767
|
+
600 wherever it lands, and `font: inherit` would quietly take that away.
|
|
768
|
+
|
|
769
|
+
The hover is written `:where(:hover)` so it weighs one class and the ink
|
|
770
|
+
layer still lands on top - see rule 6's addendum. A link in a caption that
|
|
771
|
+
says `axi-link axi-ink-dim` must stay dim under the cursor, and the plain
|
|
772
|
+
`:hover` form is what made the danger button read white under one. */
|
|
773
|
+
.axi-link,
|
|
774
|
+
.axi-prose a {
|
|
775
|
+
padding: 0;
|
|
776
|
+
background: none;
|
|
777
|
+
border: 0;
|
|
778
|
+
font-family: inherit;
|
|
779
|
+
font-size: inherit;
|
|
780
|
+
font-weight: 600;
|
|
781
|
+
color: var(--axi-accent);
|
|
782
|
+
text-decoration: underline;
|
|
783
|
+
text-underline-offset: 2px;
|
|
784
|
+
cursor: pointer;
|
|
785
|
+
}
|
|
786
|
+
.axi-link:where(:hover),
|
|
787
|
+
.axi-prose a:where(:hover) { color: var(--axi-text); }
|
|
788
|
+
|
|
746
789
|
/* ---------- keyboard key ---------- */
|
|
747
790
|
/* A key on the keyboard, named in the interface: the Esc that closes a
|
|
748
791
|
palette, the Ctrl K that opens it. Drawn as a small control rather than as a
|
|
@@ -2745,10 +2788,9 @@ textarea.axi-input {
|
|
|
2745
2788
|
|
|
2746
2789
|
.axi-prose p { margin: 0 0 16px; }
|
|
2747
2790
|
.axi-prose strong { color: var(--axi-text); font-weight: 800; }
|
|
2748
|
-
/*
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
.axi-prose a:hover { color: var(--axi-text); }
|
|
2791
|
+
/* A link is drawn beside .axi-code in primitives.css, in one rule with
|
|
2792
|
+
`.axi-link`, because a link in an article and a link in interface copy are
|
|
2793
|
+
the same object. See the comment there. */
|
|
2752
2794
|
|
|
2753
2795
|
.axi-prose ul, .axi-prose ol { margin: 0 0 16px; padding-left: 22px; }
|
|
2754
2796
|
.axi-prose li { margin: 0 0 7px; }
|
package/docs/RULES.md
CHANGED
|
@@ -703,6 +703,20 @@ whole section exists to prevent.
|
|
|
703
703
|
The test to write is not "does `.axi-code` exist". It is "are both spellings in
|
|
704
704
|
the same rule", because only the second one fails when someone splits them.
|
|
705
705
|
|
|
706
|
+
This has now happened twice. `.axi-prose a` was the language's only word for a
|
|
707
|
+
link, and the same consumer had fifteen hand-spelled ones — a third of them
|
|
708
|
+
`<button>`s calling a desktop bridge rather than anchors at all, which is what
|
|
709
|
+
made the drift concrete rather than theoretical: an `<a href>` draws its own
|
|
710
|
+
underline and a `<button>` does not, so the two spellings were not merely
|
|
711
|
+
allowed to come apart, they had already come apart. When you lift a
|
|
712
|
+
layer-scoped style out, look for the declarations the layer was getting for
|
|
713
|
+
free from its element. Those are the ones the new spelling silently loses.
|
|
714
|
+
|
|
715
|
+
Two instances is a pattern, so the check belongs at the top of the list when
|
|
716
|
+
adding anything: grep `src/` for the component's style living behind a layer
|
|
717
|
+
prefix. If it does, it has consumers you cannot see, and they have already
|
|
718
|
+
drawn their own.
|
|
719
|
+
|
|
706
720
|
### A refusal holds at every level, not just the one it was written for
|
|
707
721
|
|
|
708
722
|
The rail refuses two accent fills inside itself. That is why
|
package/package.json
CHANGED
package/src/primitives.css
CHANGED
|
@@ -450,6 +450,49 @@ button.axi-panel--tile:hover,
|
|
|
450
450
|
padding: 1px 5px;
|
|
451
451
|
}
|
|
452
452
|
|
|
453
|
+
/* ---------- link ---------- */
|
|
454
|
+
/* The same trap .axi-code was pulled out of, one component later. `.axi-prose
|
|
455
|
+
a` was the language's only word for a link, and it is reachable only by
|
|
456
|
+
adopting a whole typography layer - so a consumer with a "learn more" beside
|
|
457
|
+
a setting, or a docs URL in a modal footer, writes its own. One real consumer
|
|
458
|
+
had fifteen of them, hand-spelled, and a third of those were <button>s
|
|
459
|
+
calling an openExternal bridge rather than anchors at all.
|
|
460
|
+
|
|
461
|
+
Both selectors, one rule, for the reason written at .axi-code: a link in
|
|
462
|
+
rendered markdown and a link in interface copy are the same object, and the
|
|
463
|
+
last time this language spelled one object twice the two copies drifted.
|
|
464
|
+
There is a test that they stay one rule.
|
|
465
|
+
|
|
466
|
+
The underline is stated rather than inherited. An <a href> draws one by
|
|
467
|
+
default and a <button> does not, so leaving it to the user agent is exactly
|
|
468
|
+
how the two spellings would come apart - the declaration is a no-op on the
|
|
469
|
+
anchor and load-bearing on the button. Same for the background, border and
|
|
470
|
+
padding resets: they say nothing about an anchor and are the whole reason a
|
|
471
|
+
button can wear this class.
|
|
472
|
+
|
|
473
|
+
`font-family` and `font-size` inherit, but the weight does not: a link is
|
|
474
|
+
600 wherever it lands, and `font: inherit` would quietly take that away.
|
|
475
|
+
|
|
476
|
+
The hover is written `:where(:hover)` so it weighs one class and the ink
|
|
477
|
+
layer still lands on top - see rule 6's addendum. A link in a caption that
|
|
478
|
+
says `axi-link axi-ink-dim` must stay dim under the cursor, and the plain
|
|
479
|
+
`:hover` form is what made the danger button read white under one. */
|
|
480
|
+
.axi-link,
|
|
481
|
+
.axi-prose a {
|
|
482
|
+
padding: 0;
|
|
483
|
+
background: none;
|
|
484
|
+
border: 0;
|
|
485
|
+
font-family: inherit;
|
|
486
|
+
font-size: inherit;
|
|
487
|
+
font-weight: 600;
|
|
488
|
+
color: var(--axi-accent);
|
|
489
|
+
text-decoration: underline;
|
|
490
|
+
text-underline-offset: 2px;
|
|
491
|
+
cursor: pointer;
|
|
492
|
+
}
|
|
493
|
+
.axi-link:where(:hover),
|
|
494
|
+
.axi-prose a:where(:hover) { color: var(--axi-text); }
|
|
495
|
+
|
|
453
496
|
/* ---------- keyboard key ---------- */
|
|
454
497
|
/* A key on the keyboard, named in the interface: the Esc that closes a
|
|
455
498
|
palette, the Ctrl K that opens it. Drawn as a small control rather than as a
|
package/src/prose.css
CHANGED
|
@@ -28,10 +28,9 @@
|
|
|
28
28
|
|
|
29
29
|
.axi-prose p { margin: 0 0 16px; }
|
|
30
30
|
.axi-prose strong { color: var(--axi-text); font-weight: 800; }
|
|
31
|
-
/*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
.axi-prose a:hover { color: var(--axi-text); }
|
|
31
|
+
/* A link is drawn beside .axi-code in primitives.css, in one rule with
|
|
32
|
+
`.axi-link`, because a link in an article and a link in interface copy are
|
|
33
|
+
the same object. See the comment there. */
|
|
35
34
|
|
|
36
35
|
.axi-prose ul, .axi-prose ol { margin: 0 0 16px; padding-left: 22px; }
|
|
37
36
|
.axi-prose li { margin: 0 0 7px; }
|