@jasonsdevspace/design-kit 0.1.0-next.1 → 0.1.0-next.3

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/base.css CHANGED
@@ -1,17 +1,21 @@
1
1
  /*
2
- * What every page takes before any component: the page's type and colors, one focus ring for
3
- * every link and control, and motion cut short for a visitor who asks for less. Every rule sits
4
- * in the kit's base layer, so a demo's own rule outside a layer wins over the kit's however little
5
- * it weighs. Every selector but the visually hidden class is one :where(), followed at most by a
6
- * focus pseudo-class. The cut to motion is the exception to a demo's rule winning. It is held with
7
- * !important, so it wins over every normal rule a page writes, and the layer makes it win over a
8
- * page's important rule outside a layer too, since the visitor's choice outranks the demo's.
2
+ * What every page takes before any component: the page's type and colors, one focus ring for every
3
+ * link and control, and motion cut short for a visitor who asks for less. Every rule sits in the
4
+ * kit's base layer, so a demo's own rule outside a layer wins over the kit's however little it
5
+ * weighs. Every selector is the visually hidden class or one :where(), followed at most by a focus
6
+ * pseudo-class, or by a pseudo-element where a rule for every element has to reach it too, since
7
+ * a pseudo-element inside a :where() matches nothing. The cut to motion is the exception to a
8
+ * demo's rule winning. It is held with !important, so it wins over every normal rule a page writes,
9
+ * and the layer makes it win over a page's important rule outside a layer too, since the visitor's
10
+ * choice outranks the demo's.
9
11
  *
10
12
  * Load tokens.css first, since its first statement declares the order of the kit's layers.
11
13
  */
12
14
 
13
15
  @layer dk.base {
14
- :where(*, *::before, *::after) {
16
+ :where(*),
17
+ :where(*)::before,
18
+ :where(*)::after {
15
19
  box-sizing: border-box;
16
20
  }
17
21
 
@@ -44,6 +48,20 @@
44
48
  font-family: var(--dk-font-mono);
45
49
  }
46
50
 
51
+ /*
52
+ * Code in running text, a step under the text around it, breaks anywhere it must, since a
53
+ * long name has no spaces to break at and would push a narrow column wider. In a block it
54
+ * takes the block's size, and the block keeps its lines as written.
55
+ */
56
+ :where(code) {
57
+ font-size: var(--dk-text-code);
58
+ overflow-wrap: anywhere;
59
+ }
60
+
61
+ :where(pre code) {
62
+ font-size: inherit;
63
+ }
64
+
47
65
  /* A block of code too wide for a phone scrolls inside itself rather than moving the page. */
48
66
  :where(pre) {
49
67
  overflow-x: auto;
@@ -115,10 +133,20 @@
115
133
  /*
116
134
  * A visitor who asks for less motion gets every animation played once and every transition cut
117
135
  * to a hundredth of a millisecond, with no delay before either, and a jump rather than a smooth
118
- * scroll. Marked important, since the visitor's setting outranks a page's own animation.
136
+ * scroll. That reaches every element, its ::before and ::after, a dialog's ::backdrop and each
137
+ * part of a view transition. Marked important, since the visitor's setting outranks a page's
138
+ * own animation.
119
139
  */
120
140
  @media (prefers-reduced-motion: reduce) {
121
- :where(*, *::before, *::after) {
141
+ :where(*),
142
+ :where(*)::before,
143
+ :where(*)::after,
144
+ :where(*)::backdrop,
145
+ :where(:root)::view-transition,
146
+ :where(:root)::view-transition-group(*),
147
+ :where(:root)::view-transition-image-pair(*),
148
+ :where(:root)::view-transition-old(*),
149
+ :where(:root)::view-transition-new(*) {
122
150
  animation-duration: 0.01ms !important;
123
151
  animation-delay: 0s !important;
124
152
  animation-iteration-count: 1 !important;