@grafctory/skin 0.0.0-stage → 0.3.2

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.
Files changed (78) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +482 -2
  3. package/dist/index.core.d.ts +201 -0
  4. package/dist/index.core.d.ts.map +1 -0
  5. package/dist/index.core.js +17 -0
  6. package/dist/index.core.js.map +1 -0
  7. package/dist/index.css +130 -0
  8. package/dist/index.d.ts +432 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +184 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/markup/alerts.css +83 -0
  13. package/dist/markup/blocks.css +255 -0
  14. package/dist/markup/forms.css +552 -0
  15. package/dist/markup/headings.css +131 -0
  16. package/dist/markup/highlights.css +38 -0
  17. package/dist/markup/inlines.css +181 -0
  18. package/dist/markup/lists.css +202 -0
  19. package/dist/markup/reset.css +38 -0
  20. package/dist/markup/tables.css +87 -0
  21. package/dist/presets/inter.css +194 -0
  22. package/dist/presets/roboto.css +198 -0
  23. package/dist/tokens/borders.css +151 -0
  24. package/dist/tokens/borders.d.ts +61 -0
  25. package/dist/tokens/borders.d.ts.map +1 -0
  26. package/dist/tokens/borders.js +76 -0
  27. package/dist/tokens/borders.js.map +1 -0
  28. package/dist/tokens/colors.css +516 -0
  29. package/dist/tokens/colors.d.ts +172 -0
  30. package/dist/tokens/colors.d.ts.map +1 -0
  31. package/dist/tokens/colors.js +187 -0
  32. package/dist/tokens/colors.js.map +1 -0
  33. package/dist/tokens/elevations.css +110 -0
  34. package/dist/tokens/elevations.d.ts +54 -0
  35. package/dist/tokens/elevations.d.ts.map +1 -0
  36. package/dist/tokens/elevations.js +69 -0
  37. package/dist/tokens/elevations.js.map +1 -0
  38. package/dist/tokens/layers.css +57 -0
  39. package/dist/tokens/layers.d.ts +34 -0
  40. package/dist/tokens/layers.d.ts.map +1 -0
  41. package/dist/tokens/layers.js +49 -0
  42. package/dist/tokens/layers.js.map +1 -0
  43. package/dist/tokens/motions.css +91 -0
  44. package/dist/tokens/motions.d.ts +40 -0
  45. package/dist/tokens/motions.d.ts.map +1 -0
  46. package/dist/tokens/motions.js +55 -0
  47. package/dist/tokens/motions.js.map +1 -0
  48. package/dist/tokens/opacities.css +41 -0
  49. package/dist/tokens/opacities.d.ts +32 -0
  50. package/dist/tokens/opacities.d.ts.map +1 -0
  51. package/dist/tokens/opacities.js +47 -0
  52. package/dist/tokens/opacities.js.map +1 -0
  53. package/dist/tokens/palettes.css +546 -0
  54. package/dist/tokens/palettes.d.ts +140 -0
  55. package/dist/tokens/palettes.d.ts.map +1 -0
  56. package/dist/tokens/palettes.js +155 -0
  57. package/dist/tokens/palettes.js.map +1 -0
  58. package/dist/tokens/scalings.css +81 -0
  59. package/dist/tokens/scalings.d.ts +31 -0
  60. package/dist/tokens/scalings.d.ts.map +1 -0
  61. package/dist/tokens/scalings.js +46 -0
  62. package/dist/tokens/scalings.js.map +1 -0
  63. package/dist/tokens/spacings.css +78 -0
  64. package/dist/tokens/spacings.d.ts +34 -0
  65. package/dist/tokens/spacings.d.ts.map +1 -0
  66. package/dist/tokens/spacings.js +49 -0
  67. package/dist/tokens/spacings.js.map +1 -0
  68. package/dist/tokens/typography.css +156 -0
  69. package/dist/tokens/typography.d.ts +77 -0
  70. package/dist/tokens/typography.d.ts.map +1 -0
  71. package/dist/tokens/typography.js +92 -0
  72. package/dist/tokens/typography.js.map +1 -0
  73. package/dist/tokens/viewports.css +101 -0
  74. package/dist/tokens/viewports.d.ts +75 -0
  75. package/dist/tokens/viewports.d.ts.map +1 -0
  76. package/dist/tokens/viewports.js +90 -0
  77. package/dist/tokens/viewports.js.map +1 -0
  78. package/package.json +87 -4
@@ -0,0 +1,194 @@
1
+ /*
2
+ * Copyright © 2023-2026 Metreeca srl
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /* The design system set in Inter, Inter Tight for headings and Geist Mono for code, bundled with the app. */
18
+
19
+ @import "../index.css";
20
+
21
+ /* A font face is unaffected by a layer, so the faces stay outside it. */
22
+
23
+ @import "@fontsource-variable/inter";
24
+ @import "@fontsource-variable/inter-tight";
25
+
26
+ /*
27
+ * Geist Mono sits 3% below Inter's x-height and runs 27% wider, so it is scaled to match the lowercase of the text,
28
+ * then nudged down to offset the width, so it matches wherever the mono family is set. The faces restate those
29
+ * its package publishes, differing only in the family they are named under and in the size adjustment.
30
+ */
31
+
32
+ @font-face {
33
+ font-family: "Skin Geist Mono";
34
+ font-style: normal;
35
+ font-display: swap;
36
+ font-weight: 100 900;
37
+ src: url("@fontsource-variable/geist-mono/files/geist-mono-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
38
+ unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
39
+ size-adjust: 96%;
40
+ }
41
+
42
+ @font-face {
43
+ font-family: "Skin Geist Mono";
44
+ font-style: normal;
45
+ font-display: swap;
46
+ font-weight: 100 900;
47
+ src: url("@fontsource-variable/geist-mono/files/geist-mono-cyrillic-wght-normal.woff2") format("woff2-variations");
48
+ unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
49
+ size-adjust: 96%;
50
+ }
51
+
52
+ @font-face {
53
+ font-family: "Skin Geist Mono";
54
+ font-style: normal;
55
+ font-display: swap;
56
+ font-weight: 100 900;
57
+ src: url("@fontsource-variable/geist-mono/files/geist-mono-symbols2-wght-normal.woff2") format("woff2-variations");
58
+ unicode-range: U+2000-2001,U+2004-2008,U+200A,U+23B8-23BD,U+2500-259F;
59
+ size-adjust: 96%;
60
+ }
61
+
62
+ @font-face {
63
+ font-family: "Skin Geist Mono";
64
+ font-style: normal;
65
+ font-display: swap;
66
+ font-weight: 100 900;
67
+ src: url("@fontsource-variable/geist-mono/files/geist-mono-vietnamese-wght-normal.woff2") format("woff2-variations");
68
+ unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
69
+ size-adjust: 96%;
70
+ }
71
+
72
+ @font-face {
73
+ font-family: "Skin Geist Mono";
74
+ font-style: normal;
75
+ font-display: swap;
76
+ font-weight: 100 900;
77
+ src: url("@fontsource-variable/geist-mono/files/geist-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
78
+ unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
79
+ size-adjust: 96%;
80
+ }
81
+
82
+ @font-face {
83
+ font-family: "Skin Geist Mono";
84
+ font-style: normal;
85
+ font-display: swap;
86
+ font-weight: 100 900;
87
+ src: url("@fontsource-variable/geist-mono/files/geist-mono-latin-wght-normal.woff2") format("woff2-variations");
88
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
89
+ size-adjust: 96%;
90
+ }
91
+
92
+ /*
93
+ * Until a face arrives, text is set in the fallback face after it, scaled to the metrics of the face it stands in
94
+ * for, so the swap leaves every box sized to its content as it was. Each design system weight takes a platform face
95
+ * of its own, since a synthesised bold runs wider; the figures are measured from the face files at those weights.
96
+ *
97
+ * The text faces stand on Arial, or on Liberation Sans and Arimo sharing its metrics where it is missing. Geist Mono
98
+ * stands on Menlo or DejaVu Sans Mono, which it is measured against, then on Courier New, Liberation Mono and Cousine,
99
+ * advancing 0.3% less: code set in them runs that much narrower until the face loads, under a pixel across a column.
100
+ */
101
+
102
+ @font-face {
103
+ font-family: "Skin Inter Fallback";
104
+ font-style: normal;
105
+ font-weight: 100 500;
106
+ src: local("Arial"), local("ArialMT"),
107
+ local("Liberation Sans"), local("LiberationSans"),
108
+ local("Arimo Regular"), local("Arimo-Regular");
109
+ size-adjust: 107.01%;
110
+ ascent-override: 90.53%;
111
+ descent-override: 22.54%;
112
+ line-gap-override: 0%;
113
+ }
114
+
115
+ @font-face {
116
+ font-family: "Skin Inter Fallback";
117
+ font-style: normal;
118
+ font-weight: 600 900;
119
+ src: local("Arial Bold"), local("Arial-BoldMT"),
120
+ local("Liberation Sans Bold"), local("LiberationSans-Bold"),
121
+ local("Arimo Bold"), local("Arimo-Bold");
122
+ size-adjust: 101.09%;
123
+ ascent-override: 95.83%;
124
+ descent-override: 23.86%;
125
+ line-gap-override: 0%;
126
+ }
127
+
128
+ @font-face {
129
+ font-family: "Skin Inter Tight Fallback";
130
+ font-style: normal;
131
+ font-weight: 100 500;
132
+ src: local("Arial"), local("ArialMT"),
133
+ local("Liberation Sans"), local("LiberationSans"),
134
+ local("Arimo Regular"), local("Arimo-Regular");
135
+ size-adjust: 96.51%;
136
+ ascent-override: 100.38%;
137
+ descent-override: 24.99%;
138
+ line-gap-override: 0%;
139
+ }
140
+
141
+ @font-face {
142
+ font-family: "Skin Inter Tight Fallback";
143
+ font-style: normal;
144
+ font-weight: 600 900;
145
+ src: local("Arial Bold"), local("Arial-BoldMT"),
146
+ local("Liberation Sans Bold"), local("LiberationSans-Bold"),
147
+ local("Arimo Bold"), local("Arimo-Bold");
148
+ size-adjust: 93.47%;
149
+ ascent-override: 103.64%;
150
+ descent-override: 25.81%;
151
+ line-gap-override: 0%;
152
+ }
153
+
154
+ @font-face {
155
+ font-family: "Skin Geist Mono Fallback";
156
+ font-style: normal;
157
+ font-weight: 100 500;
158
+ src: local("Menlo Regular"), local("Menlo-Regular"),
159
+ local("DejaVu Sans Mono"), local("DejaVuSansMono"),
160
+ local("Courier New"), local("CourierNewPSMT"),
161
+ local("Liberation Mono"), local("LiberationMono"),
162
+ local("Cousine Regular"), local("Cousine-Regular");
163
+ size-adjust: 95.67%;
164
+ ascent-override: 100.84%;
165
+ descent-override: 29.60%;
166
+ line-gap-override: 0%;
167
+ }
168
+
169
+ @font-face {
170
+ font-family: "Skin Geist Mono Fallback";
171
+ font-style: normal;
172
+ font-weight: 600 900;
173
+ src: local("Menlo Bold"), local("Menlo-Bold"),
174
+ local("DejaVu Sans Mono Bold"), local("DejaVuSansMono-Bold"),
175
+ local("Courier New Bold"), local("CourierNewPS-BoldMT"),
176
+ local("Liberation Mono Bold"), local("LiberationMono-Bold"),
177
+ local("Cousine Bold"), local("Cousine-Bold");
178
+ size-adjust: 95.67%;
179
+ ascent-override: 100.84%;
180
+ descent-override: 29.60%;
181
+ line-gap-override: 0%;
182
+ }
183
+
184
+ /* Stated in the design system layer after the token modules, so an unlayered app rule still overrides the preset. */
185
+
186
+ @layer skin {
187
+
188
+ :root {
189
+ --skin--font-family: "Inter Variable", "Skin Inter Fallback", system-ui, sans-serif;
190
+ --skin--font-family-heading: "Inter Tight Variable", "Skin Inter Tight Fallback", system-ui, sans-serif;
191
+ --skin--font-family-mono: "Skin Geist Mono", "Skin Geist Mono Fallback", ui-monospace, monospace;
192
+ }
193
+
194
+ }
@@ -0,0 +1,198 @@
1
+ /*
2
+ * Copyright © 2023-2026 Metreeca srl
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /*
18
+ * The design system set in the variable Roboto family of the Metreeca brand, bundled with the app. An app setting
19
+ * faces of its own imports index.css or another preset instead, so its build carries no Roboto files.
20
+ */
21
+
22
+ @import "../index.css";
23
+
24
+ /* A font face is unaffected by a layer, so the faces stay outside it. */
25
+
26
+ @import "@fontsource-variable/roboto";
27
+ @import "@fontsource-variable/roboto-condensed";
28
+
29
+ /*
30
+ * Roboto Mono shares Roboto's x-height and runs 36% wider, so it is scaled to match the lowercase of the text, then
31
+ * nudged down to offset the width, so it matches wherever the mono family is set. The faces restate those its
32
+ * package publishes, differing only in the family they are named under and in the size adjustment.
33
+ */
34
+
35
+ @font-face {
36
+ font-family: "Skin Roboto Mono";
37
+ font-style: normal;
38
+ font-display: swap;
39
+ font-weight: 100 700;
40
+ src: url("@fontsource-variable/roboto-mono/files/roboto-mono-cyrillic-ext-wght-normal.woff2") format("woff2-variations");
41
+ unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
42
+ size-adjust: 93%;
43
+ }
44
+
45
+ @font-face {
46
+ font-family: "Skin Roboto Mono";
47
+ font-style: normal;
48
+ font-display: swap;
49
+ font-weight: 100 700;
50
+ src: url("@fontsource-variable/roboto-mono/files/roboto-mono-cyrillic-wght-normal.woff2") format("woff2-variations");
51
+ unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
52
+ size-adjust: 93%;
53
+ }
54
+
55
+ @font-face {
56
+ font-family: "Skin Roboto Mono";
57
+ font-style: normal;
58
+ font-display: swap;
59
+ font-weight: 100 700;
60
+ src: url("@fontsource-variable/roboto-mono/files/roboto-mono-greek-wght-normal.woff2") format("woff2-variations");
61
+ unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF;
62
+ size-adjust: 93%;
63
+ }
64
+
65
+ @font-face {
66
+ font-family: "Skin Roboto Mono";
67
+ font-style: normal;
68
+ font-display: swap;
69
+ font-weight: 100 700;
70
+ src: url("@fontsource-variable/roboto-mono/files/roboto-mono-vietnamese-wght-normal.woff2") format("woff2-variations");
71
+ unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB;
72
+ size-adjust: 93%;
73
+ }
74
+
75
+ @font-face {
76
+ font-family: "Skin Roboto Mono";
77
+ font-style: normal;
78
+ font-display: swap;
79
+ font-weight: 100 700;
80
+ src: url("@fontsource-variable/roboto-mono/files/roboto-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
81
+ unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
82
+ size-adjust: 93%;
83
+ }
84
+
85
+ @font-face {
86
+ font-family: "Skin Roboto Mono";
87
+ font-style: normal;
88
+ font-display: swap;
89
+ font-weight: 100 700;
90
+ src: url("@fontsource-variable/roboto-mono/files/roboto-mono-latin-wght-normal.woff2") format("woff2-variations");
91
+ unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
92
+ size-adjust: 93%;
93
+ }
94
+
95
+ /*
96
+ * Until a face arrives, text is set in the fallback face after it, scaled to the metrics of the face it stands in
97
+ * for, so the swap leaves every box sized to its content as it was. Each design system weight takes a platform face
98
+ * of its own, since a synthesised bold runs wider; the figures are measured from the face files at those weights.
99
+ *
100
+ * The text faces stand on Arial, or on Liberation Sans and Arimo sharing its metrics where it is missing. Roboto Mono
101
+ * stands on Menlo or DejaVu Sans Mono, which it is measured against, then on Courier New, Liberation Mono and Cousine,
102
+ * advancing 0.3% less: code set in them runs that much narrower until the face loads, under a pixel across a column.
103
+ */
104
+
105
+ @font-face {
106
+ font-family: "Skin Roboto Fallback";
107
+ font-style: normal;
108
+ font-weight: 100 500;
109
+ src: local("Arial"), local("ArialMT"),
110
+ local("Liberation Sans"), local("LiberationSans"),
111
+ local("Arimo Regular"), local("Arimo-Regular");
112
+ size-adjust: 100%;
113
+ ascent-override: 92.77%;
114
+ descent-override: 24.41%;
115
+ line-gap-override: 0%;
116
+ }
117
+
118
+ @font-face {
119
+ font-family: "Skin Roboto Fallback";
120
+ font-style: normal;
121
+ font-weight: 600 900;
122
+ src: local("Arial Bold"), local("Arial-BoldMT"),
123
+ local("Liberation Sans Bold"), local("LiberationSans-Bold"),
124
+ local("Arimo Bold"), local("Arimo-Bold");
125
+ size-adjust: 93.69%;
126
+ ascent-override: 99.02%;
127
+ descent-override: 26.06%;
128
+ line-gap-override: 0%;
129
+ }
130
+
131
+ @font-face {
132
+ font-family: "Skin Roboto Condensed Fallback";
133
+ font-style: normal;
134
+ font-weight: 100 500;
135
+ src: local("Arial"), local("ArialMT"),
136
+ local("Liberation Sans"), local("LiberationSans"),
137
+ local("Arimo Regular"), local("Arimo-Regular");
138
+ size-adjust: 88.85%;
139
+ ascent-override: 104.41%;
140
+ descent-override: 27.48%;
141
+ line-gap-override: 0%;
142
+ }
143
+
144
+ @font-face {
145
+ font-family: "Skin Roboto Condensed Fallback";
146
+ font-style: normal;
147
+ font-weight: 600 900;
148
+ src: local("Arial Bold"), local("Arial-BoldMT"),
149
+ local("Liberation Sans Bold"), local("LiberationSans-Bold"),
150
+ local("Arimo Bold"), local("Arimo-Bold");
151
+ size-adjust: 83.39%;
152
+ ascent-override: 111.25%;
153
+ descent-override: 29.28%;
154
+ line-gap-override: 0%;
155
+ }
156
+
157
+ @font-face {
158
+ font-family: "Skin Roboto Mono Fallback";
159
+ font-style: normal;
160
+ font-weight: 100 500;
161
+ src: local("Menlo Regular"), local("Menlo-Regular"),
162
+ local("DejaVu Sans Mono"), local("DejaVuSansMono"),
163
+ local("Courier New"), local("CourierNewPSMT"),
164
+ local("Liberation Mono"), local("LiberationMono"),
165
+ local("Cousine Regular"), local("Cousine-Regular");
166
+ size-adjust: 92.70%;
167
+ ascent-override: 105.13%;
168
+ descent-override: 27.19%;
169
+ line-gap-override: 0%;
170
+ }
171
+
172
+ @font-face {
173
+ font-family: "Skin Roboto Mono Fallback";
174
+ font-style: normal;
175
+ font-weight: 600 900;
176
+ src: local("Menlo Bold"), local("Menlo-Bold"),
177
+ local("DejaVu Sans Mono Bold"), local("DejaVuSansMono-Bold"),
178
+ local("Courier New Bold"), local("CourierNewPS-BoldMT"),
179
+ local("Liberation Mono Bold"), local("LiberationMono-Bold"),
180
+ local("Cousine Bold"), local("Cousine-Bold");
181
+ size-adjust: 92.70%;
182
+ ascent-override: 105.13%;
183
+ descent-override: 27.19%;
184
+ line-gap-override: 0%;
185
+ }
186
+
187
+ /* Stated in the design system layer after the token modules, so an unlayered app rule still overrides the preset. */
188
+
189
+ @layer skin {
190
+
191
+ :root {
192
+ --skin--font-family: "Roboto Variable", "Skin Roboto Fallback", system-ui, sans-serif;
193
+ --skin--font-family-heading:
194
+ "Roboto Condensed Variable", "Skin Roboto Condensed Fallback", system-ui, sans-serif;
195
+ --skin--font-family-mono: "Skin Roboto Mono", "Skin Roboto Mono Fallback", ui-monospace, monospace;
196
+ }
197
+
198
+ }
@@ -0,0 +1,151 @@
1
+ /*
2
+ * Copyright © 2023-2026 Metreeca srl
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ /*
18
+ * What is drawn at the edge of a box: the line that encloses it, the corner that rounds it, the outline that marks it
19
+ * focused and the one that marks it invalid. The stroke widths sit here too, carrying the weight of a drawn line
20
+ * where the line is a vector glyph rather than a border, plain or beside strong text.
21
+ *
22
+ * Nothing here carries a plain default beside its ladder: a box names the step it rounds on, as it names the step it
23
+ * is spaced on, so one reading serves both. The border radius token is no such default, since no rule reads it: it
24
+ * rounds the one element it is assigned to.
25
+ */
26
+
27
+ @property --skin--border-style {
28
+ syntax: "*";
29
+ inherits: true;
30
+ initial-value: solid;
31
+ }
32
+
33
+ @property --skin--border-color {
34
+ syntax: "*";
35
+ inherits: true;
36
+ }
37
+
38
+ @property --skin--border-color-field {
39
+ syntax: "*";
40
+ inherits: true;
41
+ }
42
+
43
+ @property --skin--border-width {
44
+ syntax: "<length>";
45
+ inherits: true;
46
+ initial-value: 1px;
47
+ }
48
+
49
+ /*
50
+ * The radius ladder rounds a corner by a length, on the steps the spacing ladder carries and stated the same way, in
51
+ * em, so a subtree given a size of its own rounds to match. A step rounds a box by the same amount whatever size the
52
+ * box is given, which is what tells one corner from another down a column of boxes of differing heights.
53
+ *
54
+ * A shape rather than a corner — a roundel, a swatch, an avatar, a pill — is NOT a step on this ladder: it is a
55
+ * share of the box, so it follows the size rather than the rhythm, and it is stated by the component drawing it.
56
+ */
57
+
58
+ @property --skin--border-radius-025 {
59
+ syntax: "*";
60
+ inherits: true;
61
+ initial-value: 0.25em;
62
+ }
63
+
64
+ @property --skin--border-radius-050 {
65
+ syntax: "*";
66
+ inherits: true;
67
+ initial-value: 0.5em;
68
+ }
69
+
70
+ @property --skin--border-radius-075 {
71
+ syntax: "*";
72
+ inherits: true;
73
+ initial-value: 0.75em;
74
+ }
75
+
76
+ @property --skin--border-radius-100 {
77
+ syntax: "*";
78
+ inherits: true;
79
+ initial-value: 1em;
80
+ }
81
+
82
+ /* The rounding of the one element it is assigned to, set from a step and read by no rule, square if unassigned. */
83
+
84
+ @property --skin--border-radius {
85
+ syntax: "*";
86
+ inherits: true;
87
+ initial-value: 0;
88
+ }
89
+
90
+ @property --skin--outline-focus {
91
+ syntax: "*";
92
+ inherits: true;
93
+ }
94
+
95
+ @property --skin--outline-invalid {
96
+ syntax: "*";
97
+ inherits: true;
98
+ }
99
+
100
+ /*
101
+ * A bare number, in the user units of the vector viewport it applies to, so the weight of a glyph holds at any size.
102
+ */
103
+
104
+ @property --skin--stroke-width {
105
+ syntax: "<number>";
106
+ inherits: true;
107
+ initial-value: 2;
108
+ }
109
+
110
+ @property --skin--stroke-width-strong {
111
+ syntax: "*";
112
+ inherits: true;
113
+ }
114
+
115
+ /*
116
+ * The values standing on other tokens, which an initial value cannot carry: the enclosing line takes the disabled
117
+ * colour, and the two marks are assembled from the width, the style and the colour role each one signals. The focus
118
+ * mark is drawn heavier than the line, so it reads as a mark rather than as a second border.
119
+ */
120
+
121
+ :root {
122
+
123
+ /*
124
+ * A line and a disabled label both stand for a thing carrying no meaning of its own, so the two coincide by design
125
+ * and a contrast check passes over both. They sit halfway in lightness between the stripe and the field line, at
126
+ * 1.81:1 and 1.73:1 on the page in the light and the dark scheme, so a disabled field is told from an active one
127
+ * while its edge stays in sight. A line that identifies a control takes the field line below instead, since WCAG
128
+ * holds a control boundary to 3:1 and exempts only the boundary of a control that is disabled.
129
+ */
130
+
131
+ --skin--border-color: var(--skin--color-disabled);
132
+
133
+ /*
134
+ * A field is told from the page by its edge alone, the edit background sitting a hair off the page, so its line is
135
+ * held to the 3:1 a control boundary takes: 3.01:1 on the stripe, the tightest surface, in the light scheme and
136
+ * 3.03:1 in the dark one, the shares being the lightest that hold it there.
137
+ */
138
+
139
+ --skin--border-color-field: light-dark(
140
+ color-mix(in oklab, var(--skin--color) 35%, var(--skin--background-color)),
141
+ color-mix(in oklab, var(--skin--color) 42.5%, var(--skin--background-color))
142
+ );
143
+
144
+ --skin--outline-focus: var(--skin--border-style) calc(2 * var(--skin--border-width)) var(--skin--color-focus);
145
+ --skin--outline-invalid: var(--skin--border-style) var(--skin--border-width) var(--skin--color-fail);
146
+
147
+ /* A glyph set beside strong text is stroked thicker, to match the heavier letters beside it. */
148
+
149
+ --skin--stroke-width-strong: calc(1.5 * var(--skin--stroke-width));
150
+
151
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Border tokens.
3
+ *
4
+ * Names what is drawn at the edge of a box: the line enclosing it, the corner rounding it, the outline marking it
5
+ * focused and the one marking it invalid, together with the weights a vector glyph is stroked at.
6
+ *
7
+ * @remarks
8
+ *
9
+ * **Line** — `borderColor` draws an enclosing line in the colour of {@link colors `colorDisabled`}, since a line, like
10
+ * a disabled label, carries no meaning of its own. The two share one value, so an app retuning the disabled colour
11
+ * retunes every line along with it, and a contrast check passes over both of them. `borderColorField` draws the
12
+ * edge of a field, the line that tells it apart from the page, so it holds the 3:1 a control boundary takes on the
13
+ * page, the striped row and the edit background for the shipped page and text anchors. A disabled field falls back
14
+ * to the enclosing line, which stays in sight on the page but reads lighter than the edge of a field taking input.
15
+ *
16
+ * **Radii** — `borderRadius025` to `borderRadius100` round a corner by a length, on the steps
17
+ * {@link spacings the spacing ladder} carries and stated the same way, in `em`, so a box rounds by the same amount
18
+ * whatever size it is given and a subtree given a size of its own rounds to match. A shape rather than a corner, a
19
+ * roundel or a pill, is a share of its box rather than a step on this ladder, and the component drawing it says so.
20
+ *
21
+ * **Rounding** — `borderRadius` is not a step but the rounding of the element it is assigned to, set from a step: no
22
+ * rule reads it, and assigning it through {@link index.css css} rounds that element alone.
23
+ *
24
+ * **Marks** — `outlineFocus` and `outlineInvalid` are whole `outline` shorthand values rather than colours, so a rule
25
+ * states the mark in one declaration and an app retuning the anchors carries it along. The shorthand leaves out
26
+ * `outline-offset`, so a rule setting either mark states the offset too. They pair with the {@link colors `colorFocus`}
27
+ * and {@link colors `colorFail`} roles, which a consumer reaches for where it paints the mark itself.
28
+ *
29
+ * A field shows a failure by painting its own edge in `colorFail`, so the failure and the focus ring show together.
30
+ * `outlineInvalid` is for a control with no edge to colour, such as a checkbox or a radio button, and gives way to the
31
+ * focus ring while the control has the keyboard. The focus ring holds 3:1 neither against a fill in
32
+ * {@link colors `colorStrong`} nor against the edge of a field. A rule ringing a field draws it just inside the edge,
33
+ * and a rule ringing a filled control offsets it outside by the line width, where it holds 3:1 against the page.
34
+ *
35
+ * **Strokes** — `strokeWidth` is a bare number in viewport user units, so a glyph keeps its weight at any size.
36
+ * `strokeWidthStrong` is the stroke counterpart of {@link typography `fontWeightStrong`}: a glyph set beside strong
37
+ * text takes it, so the two read at the same weight. It derives from `strokeWidth`, so an app retunes both at once.
38
+ *
39
+ * @module borders
40
+ */
41
+ /**
42
+ * The custom property behind every border token.
43
+ *
44
+ * Narrowed to literals, so the design system contract can name the tokens and the custom properties they resolve to.
45
+ */
46
+ export declare const borders: {
47
+ readonly borderStyle: "--skin--border-style";
48
+ readonly borderColor: "--skin--border-color";
49
+ readonly borderColorField: "--skin--border-color-field";
50
+ readonly borderWidth: "--skin--border-width";
51
+ readonly borderRadius025: "--skin--border-radius-025";
52
+ readonly borderRadius050: "--skin--border-radius-050";
53
+ readonly borderRadius075: "--skin--border-radius-075";
54
+ readonly borderRadius100: "--skin--border-radius-100";
55
+ readonly borderRadius: "--skin--border-radius";
56
+ readonly outlineFocus: "--skin--outline-focus";
57
+ readonly outlineInvalid: "--skin--outline-invalid";
58
+ readonly strokeWidth: "--skin--stroke-width";
59
+ readonly strokeWidthStrong: "--skin--stroke-width-strong";
60
+ };
61
+ //# sourceMappingURL=borders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"borders.d.ts","sourceRoot":"","sources":["../../src/tokens/borders.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAGH;;;;GAIG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;CAmBV,CAAC"}
@@ -0,0 +1,76 @@
1
+ /*
2
+ * Copyright © 2023-2026 Metreeca srl
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Border tokens.
18
+ *
19
+ * Names what is drawn at the edge of a box: the line enclosing it, the corner rounding it, the outline marking it
20
+ * focused and the one marking it invalid, together with the weights a vector glyph is stroked at.
21
+ *
22
+ * @remarks
23
+ *
24
+ * **Line** — `borderColor` draws an enclosing line in the colour of {@link colors `colorDisabled`}, since a line, like
25
+ * a disabled label, carries no meaning of its own. The two share one value, so an app retuning the disabled colour
26
+ * retunes every line along with it, and a contrast check passes over both of them. `borderColorField` draws the
27
+ * edge of a field, the line that tells it apart from the page, so it holds the 3:1 a control boundary takes on the
28
+ * page, the striped row and the edit background for the shipped page and text anchors. A disabled field falls back
29
+ * to the enclosing line, which stays in sight on the page but reads lighter than the edge of a field taking input.
30
+ *
31
+ * **Radii** — `borderRadius025` to `borderRadius100` round a corner by a length, on the steps
32
+ * {@link spacings the spacing ladder} carries and stated the same way, in `em`, so a box rounds by the same amount
33
+ * whatever size it is given and a subtree given a size of its own rounds to match. A shape rather than a corner, a
34
+ * roundel or a pill, is a share of its box rather than a step on this ladder, and the component drawing it says so.
35
+ *
36
+ * **Rounding** — `borderRadius` is not a step but the rounding of the element it is assigned to, set from a step: no
37
+ * rule reads it, and assigning it through {@link index.css css} rounds that element alone.
38
+ *
39
+ * **Marks** — `outlineFocus` and `outlineInvalid` are whole `outline` shorthand values rather than colours, so a rule
40
+ * states the mark in one declaration and an app retuning the anchors carries it along. The shorthand leaves out
41
+ * `outline-offset`, so a rule setting either mark states the offset too. They pair with the {@link colors `colorFocus`}
42
+ * and {@link colors `colorFail`} roles, which a consumer reaches for where it paints the mark itself.
43
+ *
44
+ * A field shows a failure by painting its own edge in `colorFail`, so the failure and the focus ring show together.
45
+ * `outlineInvalid` is for a control with no edge to colour, such as a checkbox or a radio button, and gives way to the
46
+ * focus ring while the control has the keyboard. The focus ring holds 3:1 neither against a fill in
47
+ * {@link colors `colorStrong`} nor against the edge of a field. A rule ringing a field draws it just inside the edge,
48
+ * and a rule ringing a filled control offsets it outside by the line width, where it holds 3:1 against the page.
49
+ *
50
+ * **Strokes** — `strokeWidth` is a bare number in viewport user units, so a glyph keeps its weight at any size.
51
+ * `strokeWidthStrong` is the stroke counterpart of {@link typography `fontWeightStrong`}: a glyph set beside strong
52
+ * text takes it, so the two read at the same weight. It derives from `strokeWidth`, so an app retunes both at once.
53
+ *
54
+ * @module borders
55
+ */
56
+ /**
57
+ * The custom property behind every border token.
58
+ *
59
+ * Narrowed to literals, so the design system contract can name the tokens and the custom properties they resolve to.
60
+ */
61
+ export const borders = {
62
+ borderStyle: "--skin--border-style",
63
+ borderColor: "--skin--border-color",
64
+ borderColorField: "--skin--border-color-field",
65
+ borderWidth: "--skin--border-width",
66
+ borderRadius025: "--skin--border-radius-025",
67
+ borderRadius050: "--skin--border-radius-050",
68
+ borderRadius075: "--skin--border-radius-075",
69
+ borderRadius100: "--skin--border-radius-100",
70
+ borderRadius: "--skin--border-radius",
71
+ outlineFocus: "--skin--outline-focus",
72
+ outlineInvalid: "--skin--outline-invalid",
73
+ strokeWidth: "--skin--stroke-width",
74
+ strokeWidthStrong: "--skin--stroke-width-strong"
75
+ };
76
+ //# sourceMappingURL=borders.js.map