@med-o/design-tokens 0.1.0 → 0.4.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/css/tokens.css +41 -0
- package/dist/css/typography.css +1 -2
- package/dist/docs/tokens.light.json +80 -2
- package/dist/js/tokens.js +7 -1
- package/dist/tailwind/theme.css +7 -1
- package/package.json +1 -1
- package/src/layout/desktop.json +32 -0
- package/src/layout/mobile.json +32 -0
- package/src/layout/tablet.json +32 -0
- package/src/motion.json +2 -2
- package/src/typography.json +1 -6
package/dist/css/tokens.css
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Theme: follows the system setting. Force a theme with data-theme="light" | "dark"
|
|
6
6
|
* on <html> or on any element (the theme then applies to that subtree).
|
|
7
|
+
* Contrast: “Increase contrast” in the system (prefers-contrast: more) strengthens secondary text and borders.
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
:root {
|
|
@@ -406,6 +407,12 @@
|
|
|
406
407
|
--medo-layout-gutter: 1rem;
|
|
407
408
|
--medo-layout-margin: 1rem;
|
|
408
409
|
--medo-layout-section: 3rem;
|
|
410
|
+
--medo-layout-gap-inline: var(--medo-space-2);
|
|
411
|
+
--medo-layout-gap-content: var(--medo-space-4);
|
|
412
|
+
--medo-layout-gap-fields: var(--medo-space-4);
|
|
413
|
+
--medo-layout-gap-items: var(--medo-layout-gutter);
|
|
414
|
+
--medo-layout-gap-group: var(--medo-space-8);
|
|
415
|
+
--medo-layout-gap-section: var(--medo-layout-section);
|
|
409
416
|
}
|
|
410
417
|
|
|
411
418
|
[data-theme="light"] {
|
|
@@ -713,6 +720,28 @@
|
|
|
713
720
|
}
|
|
714
721
|
}
|
|
715
722
|
|
|
723
|
+
/* Higher contrast: the system setting “Increase contrast” (prefers-contrast: more). */
|
|
724
|
+
@media (prefers-contrast: more) {
|
|
725
|
+
:root,
|
|
726
|
+
[data-theme] {
|
|
727
|
+
--medo-color-border-default: var(--medo-color-border-strong);
|
|
728
|
+
}
|
|
729
|
+
:root,
|
|
730
|
+
[data-theme="light"] {
|
|
731
|
+
--medo-color-text-secondary: var(--medo-color-neutral-700);
|
|
732
|
+
}
|
|
733
|
+
[data-theme="dark"] {
|
|
734
|
+
--medo-color-text-secondary: var(--medo-color-neutral-300);
|
|
735
|
+
}
|
|
736
|
+
@media (prefers-color-scheme: dark) {
|
|
737
|
+
/* Same specificity as the system dark block above, so both overrides are repeated here. */
|
|
738
|
+
:root:not([data-theme="light"]) {
|
|
739
|
+
--medo-color-border-default: var(--medo-color-border-strong);
|
|
740
|
+
--medo-color-text-secondary: var(--medo-color-neutral-300);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
716
745
|
/* Layout: modes Mobile (default), Tablet (≥ 640px), Desktop (≥ 1024px) */
|
|
717
746
|
@media (min-width: 640px) {
|
|
718
747
|
:root {
|
|
@@ -720,6 +749,12 @@
|
|
|
720
749
|
--medo-layout-gutter: 1.5rem;
|
|
721
750
|
--medo-layout-margin: 1.5rem;
|
|
722
751
|
--medo-layout-section: 4rem;
|
|
752
|
+
--medo-layout-gap-inline: var(--medo-space-2);
|
|
753
|
+
--medo-layout-gap-content: var(--medo-space-4);
|
|
754
|
+
--medo-layout-gap-fields: var(--medo-space-6);
|
|
755
|
+
--medo-layout-gap-items: var(--medo-layout-gutter);
|
|
756
|
+
--medo-layout-gap-group: var(--medo-space-10);
|
|
757
|
+
--medo-layout-gap-section: var(--medo-layout-section);
|
|
723
758
|
}
|
|
724
759
|
}
|
|
725
760
|
|
|
@@ -729,5 +764,11 @@
|
|
|
729
764
|
--medo-layout-gutter: 1.5rem;
|
|
730
765
|
--medo-layout-margin: 2rem;
|
|
731
766
|
--medo-layout-section: 6rem;
|
|
767
|
+
--medo-layout-gap-inline: var(--medo-space-2);
|
|
768
|
+
--medo-layout-gap-content: var(--medo-space-4);
|
|
769
|
+
--medo-layout-gap-fields: var(--medo-space-6);
|
|
770
|
+
--medo-layout-gap-items: var(--medo-layout-gutter);
|
|
771
|
+
--medo-layout-gap-group: var(--medo-space-12);
|
|
772
|
+
--medo-layout-gap-section: var(--medo-layout-section);
|
|
732
773
|
}
|
|
733
774
|
}
|
package/dist/css/typography.css
CHANGED
|
@@ -180,8 +180,7 @@
|
|
|
180
180
|
font-size: var(--medo-font-size-xs);
|
|
181
181
|
font-weight: var(--medo-font-weight-semibold);
|
|
182
182
|
line-height: 1.3333;
|
|
183
|
-
letter-spacing: var(--medo-font-tracking-
|
|
184
|
-
text-transform: uppercase;
|
|
183
|
+
letter-spacing: var(--medo-font-tracking-normal);
|
|
185
184
|
}
|
|
186
185
|
|
|
187
186
|
/* code/md */
|
|
@@ -4168,7 +4168,7 @@
|
|
|
4168
4168
|
"type": "duration",
|
|
4169
4169
|
"cssVar": "--medo-motion-duration-fast",
|
|
4170
4170
|
"value": "0.1s",
|
|
4171
|
-
"description": "100 ms: feedback – hover, pressed, focus, color and opacity. Pressed starts at once and fades out
|
|
4171
|
+
"description": "100 ms: feedback – hover, pressed, focus, color and opacity. Pressed starts at once and fades out, so a tap feels immediate."
|
|
4172
4172
|
},
|
|
4173
4173
|
{
|
|
4174
4174
|
"name": "motion/duration/normal",
|
|
@@ -4228,7 +4228,7 @@
|
|
|
4228
4228
|
"type": "cubicBezier",
|
|
4229
4229
|
"cssVar": "--medo-motion-easing-standard",
|
|
4230
4230
|
"value": "cubic-bezier(0.32, 0.72, 0, 1)",
|
|
4231
|
-
"description": "cubic-bezier(0.32, 0.72, 0, 1):
|
|
4231
|
+
"description": "cubic-bezier(0.32, 0.72, 0, 1): a strong ease-out (fast start, long soft landing) – state changes and movement within the view where no spring is used."
|
|
4232
4232
|
},
|
|
4233
4233
|
{
|
|
4234
4234
|
"name": "motion/easing/enter",
|
|
@@ -4608,5 +4608,83 @@
|
|
|
4608
4608
|
"type": "dimension",
|
|
4609
4609
|
"cssVar": "--medo-layout-section",
|
|
4610
4610
|
"value": "3rem"
|
|
4611
|
+
},
|
|
4612
|
+
{
|
|
4613
|
+
"name": "layout/gap/inline",
|
|
4614
|
+
"path": [
|
|
4615
|
+
"layout",
|
|
4616
|
+
"gap",
|
|
4617
|
+
"inline"
|
|
4618
|
+
],
|
|
4619
|
+
"type": "dimension",
|
|
4620
|
+
"cssVar": "--medo-layout-gap-inline",
|
|
4621
|
+
"value": "0.5rem",
|
|
4622
|
+
"ref": "2",
|
|
4623
|
+
"description": "Rule: elements side by side in one group – buttons, tags, filters. 8 px."
|
|
4624
|
+
},
|
|
4625
|
+
{
|
|
4626
|
+
"name": "layout/gap/content",
|
|
4627
|
+
"path": [
|
|
4628
|
+
"layout",
|
|
4629
|
+
"gap",
|
|
4630
|
+
"content"
|
|
4631
|
+
],
|
|
4632
|
+
"type": "dimension",
|
|
4633
|
+
"cssVar": "--medo-layout-gap-content",
|
|
4634
|
+
"value": "1rem",
|
|
4635
|
+
"ref": "4",
|
|
4636
|
+
"description": "Rule: inside one block – heading, text, actions. 16 px."
|
|
4637
|
+
},
|
|
4638
|
+
{
|
|
4639
|
+
"name": "layout/gap/fields",
|
|
4640
|
+
"path": [
|
|
4641
|
+
"layout",
|
|
4642
|
+
"gap",
|
|
4643
|
+
"fields"
|
|
4644
|
+
],
|
|
4645
|
+
"type": "dimension",
|
|
4646
|
+
"cssVar": "--medo-layout-gap-fields",
|
|
4647
|
+
"value": "1rem",
|
|
4648
|
+
"ref": "4",
|
|
4649
|
+
"description": "Rule: form fields below each other. 16 · 24 · 24 px."
|
|
4650
|
+
},
|
|
4651
|
+
{
|
|
4652
|
+
"name": "layout/gap/items",
|
|
4653
|
+
"path": [
|
|
4654
|
+
"layout",
|
|
4655
|
+
"gap",
|
|
4656
|
+
"items"
|
|
4657
|
+
],
|
|
4658
|
+
"type": "dimension",
|
|
4659
|
+
"cssVar": "--medo-layout-gap-items",
|
|
4660
|
+
"value": "1rem",
|
|
4661
|
+
"ref": "gutter",
|
|
4662
|
+
"description": "Rule: cards and tiles in a grid or list. Equals layout/gutter (16 · 24 · 24 px)."
|
|
4663
|
+
},
|
|
4664
|
+
{
|
|
4665
|
+
"name": "layout/gap/group",
|
|
4666
|
+
"path": [
|
|
4667
|
+
"layout",
|
|
4668
|
+
"gap",
|
|
4669
|
+
"group"
|
|
4670
|
+
],
|
|
4671
|
+
"type": "dimension",
|
|
4672
|
+
"cssVar": "--medo-layout-gap-group",
|
|
4673
|
+
"value": "2rem",
|
|
4674
|
+
"ref": "8",
|
|
4675
|
+
"description": "Rule: groups inside a section – sub-sections, fieldsets. 32 · 40 · 48 px."
|
|
4676
|
+
},
|
|
4677
|
+
{
|
|
4678
|
+
"name": "layout/gap/section",
|
|
4679
|
+
"path": [
|
|
4680
|
+
"layout",
|
|
4681
|
+
"gap",
|
|
4682
|
+
"section"
|
|
4683
|
+
],
|
|
4684
|
+
"type": "dimension",
|
|
4685
|
+
"cssVar": "--medo-layout-gap-section",
|
|
4686
|
+
"value": "3rem",
|
|
4687
|
+
"ref": "section",
|
|
4688
|
+
"description": "Rule: sections of a page. Equals layout/section (48 · 64 · 96 px)."
|
|
4611
4689
|
}
|
|
4612
4690
|
]
|
package/dist/js/tokens.js
CHANGED
|
@@ -397,7 +397,13 @@ export const tokens = {
|
|
|
397
397
|
"layout-columns": 4,
|
|
398
398
|
"layout-gutter": "1rem",
|
|
399
399
|
"layout-margin": "1rem",
|
|
400
|
-
"layout-section": "3rem"
|
|
400
|
+
"layout-section": "3rem",
|
|
401
|
+
"layout-gap-inline": "0.5rem",
|
|
402
|
+
"layout-gap-content": "1rem",
|
|
403
|
+
"layout-gap-fields": "1rem",
|
|
404
|
+
"layout-gap-items": "1rem",
|
|
405
|
+
"layout-gap-group": "2rem",
|
|
406
|
+
"layout-gap-section": "3rem"
|
|
401
407
|
};
|
|
402
408
|
|
|
403
409
|
export const darkColors = {
|
package/dist/tailwind/theme.css
CHANGED
|
@@ -110,6 +110,12 @@
|
|
|
110
110
|
|
|
111
111
|
/* Spacing: 1 step = space/1 (4px). p-4 = space/4 = 16px, p-0.5 = space/0-5. */
|
|
112
112
|
--spacing: var(--medo-space-1);
|
|
113
|
+
--spacing-inline: var(--medo-layout-gap-inline);
|
|
114
|
+
--spacing-content: var(--medo-layout-gap-content);
|
|
115
|
+
--spacing-fields: var(--medo-layout-gap-fields);
|
|
116
|
+
--spacing-items: var(--medo-layout-gap-items);
|
|
117
|
+
--spacing-group: var(--medo-layout-gap-group);
|
|
118
|
+
--spacing-section: var(--medo-layout-gap-section);
|
|
113
119
|
|
|
114
120
|
/* Radius */
|
|
115
121
|
--radius-*: initial;
|
|
@@ -231,7 +237,7 @@
|
|
|
231
237
|
--text-overline: var(--medo-font-size-xs);
|
|
232
238
|
--text-overline--line-height: 1.3333;
|
|
233
239
|
--text-overline--font-weight: var(--medo-font-weight-semibold);
|
|
234
|
-
--text-overline--letter-spacing: var(--medo-font-tracking-
|
|
240
|
+
--text-overline--letter-spacing: var(--medo-font-tracking-normal);
|
|
235
241
|
--text-code-md: var(--medo-font-size-sm);
|
|
236
242
|
--text-code-md--line-height: 1.4286;
|
|
237
243
|
--text-code-md--font-weight: var(--medo-font-weight-regular);
|
package/package.json
CHANGED
package/src/layout/desktop.json
CHANGED
|
@@ -24,6 +24,38 @@
|
|
|
24
24
|
"value": 96,
|
|
25
25
|
"unit": "px"
|
|
26
26
|
}
|
|
27
|
+
},
|
|
28
|
+
"gap": {
|
|
29
|
+
"inline": {
|
|
30
|
+
"$type": "dimension",
|
|
31
|
+
"$value": "{space.2}",
|
|
32
|
+
"$description": "Rule: elements side by side in one group – buttons, tags, filters. 8 px."
|
|
33
|
+
},
|
|
34
|
+
"content": {
|
|
35
|
+
"$type": "dimension",
|
|
36
|
+
"$value": "{space.4}",
|
|
37
|
+
"$description": "Rule: inside one block – heading, text, actions. 16 px."
|
|
38
|
+
},
|
|
39
|
+
"fields": {
|
|
40
|
+
"$type": "dimension",
|
|
41
|
+
"$value": "{space.6}",
|
|
42
|
+
"$description": "Rule: form fields below each other. 16 · 24 · 24 px."
|
|
43
|
+
},
|
|
44
|
+
"items": {
|
|
45
|
+
"$type": "dimension",
|
|
46
|
+
"$value": "{layout.gutter}",
|
|
47
|
+
"$description": "Rule: cards and tiles in a grid or list. Equals layout/gutter (16 · 24 · 24 px)."
|
|
48
|
+
},
|
|
49
|
+
"group": {
|
|
50
|
+
"$type": "dimension",
|
|
51
|
+
"$value": "{space.12}",
|
|
52
|
+
"$description": "Rule: groups inside a section – sub-sections, fieldsets. 32 · 40 · 48 px."
|
|
53
|
+
},
|
|
54
|
+
"section": {
|
|
55
|
+
"$type": "dimension",
|
|
56
|
+
"$value": "{layout.section}",
|
|
57
|
+
"$description": "Rule: sections of a page. Equals layout/section (48 · 64 · 96 px)."
|
|
58
|
+
}
|
|
27
59
|
}
|
|
28
60
|
}
|
|
29
61
|
}
|
package/src/layout/mobile.json
CHANGED
|
@@ -24,6 +24,38 @@
|
|
|
24
24
|
"value": 48,
|
|
25
25
|
"unit": "px"
|
|
26
26
|
}
|
|
27
|
+
},
|
|
28
|
+
"gap": {
|
|
29
|
+
"inline": {
|
|
30
|
+
"$type": "dimension",
|
|
31
|
+
"$value": "{space.2}",
|
|
32
|
+
"$description": "Rule: elements side by side in one group – buttons, tags, filters. 8 px."
|
|
33
|
+
},
|
|
34
|
+
"content": {
|
|
35
|
+
"$type": "dimension",
|
|
36
|
+
"$value": "{space.4}",
|
|
37
|
+
"$description": "Rule: inside one block – heading, text, actions. 16 px."
|
|
38
|
+
},
|
|
39
|
+
"fields": {
|
|
40
|
+
"$type": "dimension",
|
|
41
|
+
"$value": "{space.4}",
|
|
42
|
+
"$description": "Rule: form fields below each other. 16 · 24 · 24 px."
|
|
43
|
+
},
|
|
44
|
+
"items": {
|
|
45
|
+
"$type": "dimension",
|
|
46
|
+
"$value": "{layout.gutter}",
|
|
47
|
+
"$description": "Rule: cards and tiles in a grid or list. Equals layout/gutter (16 · 24 · 24 px)."
|
|
48
|
+
},
|
|
49
|
+
"group": {
|
|
50
|
+
"$type": "dimension",
|
|
51
|
+
"$value": "{space.8}",
|
|
52
|
+
"$description": "Rule: groups inside a section – sub-sections, fieldsets. 32 · 40 · 48 px."
|
|
53
|
+
},
|
|
54
|
+
"section": {
|
|
55
|
+
"$type": "dimension",
|
|
56
|
+
"$value": "{layout.section}",
|
|
57
|
+
"$description": "Rule: sections of a page. Equals layout/section (48 · 64 · 96 px)."
|
|
58
|
+
}
|
|
27
59
|
}
|
|
28
60
|
}
|
|
29
61
|
}
|
package/src/layout/tablet.json
CHANGED
|
@@ -24,6 +24,38 @@
|
|
|
24
24
|
"value": 64,
|
|
25
25
|
"unit": "px"
|
|
26
26
|
}
|
|
27
|
+
},
|
|
28
|
+
"gap": {
|
|
29
|
+
"inline": {
|
|
30
|
+
"$type": "dimension",
|
|
31
|
+
"$value": "{space.2}",
|
|
32
|
+
"$description": "Rule: elements side by side in one group – buttons, tags, filters. 8 px."
|
|
33
|
+
},
|
|
34
|
+
"content": {
|
|
35
|
+
"$type": "dimension",
|
|
36
|
+
"$value": "{space.4}",
|
|
37
|
+
"$description": "Rule: inside one block – heading, text, actions. 16 px."
|
|
38
|
+
},
|
|
39
|
+
"fields": {
|
|
40
|
+
"$type": "dimension",
|
|
41
|
+
"$value": "{space.6}",
|
|
42
|
+
"$description": "Rule: form fields below each other. 16 · 24 · 24 px."
|
|
43
|
+
},
|
|
44
|
+
"items": {
|
|
45
|
+
"$type": "dimension",
|
|
46
|
+
"$value": "{layout.gutter}",
|
|
47
|
+
"$description": "Rule: cards and tiles in a grid or list. Equals layout/gutter (16 · 24 · 24 px)."
|
|
48
|
+
},
|
|
49
|
+
"group": {
|
|
50
|
+
"$type": "dimension",
|
|
51
|
+
"$value": "{space.10}",
|
|
52
|
+
"$description": "Rule: groups inside a section – sub-sections, fieldsets. 32 · 40 · 48 px."
|
|
53
|
+
},
|
|
54
|
+
"section": {
|
|
55
|
+
"$type": "dimension",
|
|
56
|
+
"$value": "{layout.section}",
|
|
57
|
+
"$description": "Rule: sections of a page. Equals layout/section (48 · 64 · 96 px)."
|
|
58
|
+
}
|
|
27
59
|
}
|
|
28
60
|
}
|
|
29
61
|
}
|
package/src/motion.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"value": 100,
|
|
8
8
|
"unit": "ms"
|
|
9
9
|
},
|
|
10
|
-
"$description": "100 ms: feedback – hover, pressed, focus, color and opacity. Pressed starts at once and fades out
|
|
10
|
+
"$description": "100 ms: feedback – hover, pressed, focus, color and opacity. Pressed starts at once and fades out, so a tap feels immediate."
|
|
11
11
|
},
|
|
12
12
|
"normal": {
|
|
13
13
|
"$type": "duration",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
0,
|
|
52
52
|
1
|
|
53
53
|
],
|
|
54
|
-
"$description": "cubic-bezier(0.32, 0.72, 0, 1):
|
|
54
|
+
"$description": "cubic-bezier(0.32, 0.72, 0, 1): a strong ease-out (fast start, long soft landing) – state changes and movement within the view where no spring is used."
|
|
55
55
|
},
|
|
56
56
|
"enter": {
|
|
57
57
|
"$type": "cubicBezier",
|
package/src/typography.json
CHANGED
|
@@ -420,12 +420,7 @@
|
|
|
420
420
|
"fontSize": "{font.size.xs}",
|
|
421
421
|
"fontWeight": "{font.weight.semibold}",
|
|
422
422
|
"lineHeight": 1.3333,
|
|
423
|
-
"letterSpacing": "{font.tracking.
|
|
424
|
-
},
|
|
425
|
-
"$extensions": {
|
|
426
|
-
"com.medo": {
|
|
427
|
-
"textTransform": "uppercase"
|
|
428
|
-
}
|
|
423
|
+
"letterSpacing": "{font.tracking.normal}"
|
|
429
424
|
}
|
|
430
425
|
},
|
|
431
426
|
"code": {
|