@med-o/design-tokens 0.9.0 → 0.11.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/CHANGELOG.md +151 -0
- package/README.md +2 -0
- package/dist/css/base.css +29 -0
- package/dist/css/tokens.css +24 -0
- package/dist/docs/contrast.json +216 -0
- package/dist/docs/tokens.dark.json +78 -0
- package/dist/docs/tokens.light.json +78 -0
- package/dist/js/tokens.js +12 -0
- package/dist/tailwind/theme.css +6 -0
- package/package.json +4 -2
- package/src/color/dark.json +32 -0
- package/src/color/light.json +32 -0
- package/src/css/base.css +29 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# @med-o/design-tokens
|
|
2
|
+
|
|
3
|
+
## 0.11.0
|
|
4
|
+
|
|
5
|
+
_Released 2026-11-10_
|
|
6
|
+
|
|
7
|
+
### Minor Changes
|
|
8
|
+
|
|
9
|
+
- 68e203d: New: `css/base.css` sets up the page for apps without Tailwind.
|
|
10
|
+
|
|
11
|
+
- Removes the browser margins and sizes every box with its padding and border (`border-box`).
|
|
12
|
+
- Gives `body` the canvas color, the primary text color and the text style body/md, in Light and Dark.
|
|
13
|
+
- Sits in the cascade layer `base`, so component styles, Tailwind utilities and your own CSS always win.
|
|
14
|
+
- Import it after `tokens.css`: `@import "@med-o/design-tokens/css/base.css";`
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- 171a142: Fixed: both packages include their `CHANGELOG.md`.
|
|
19
|
+
|
|
20
|
+
What changed in each version now ships with the code you install, in `node_modules/@med-o/ui/CHANGELOG.md` and `node_modules/@med-o/design-tokens/CHANGELOG.md`.
|
|
21
|
+
|
|
22
|
+
## 0.10.0
|
|
23
|
+
|
|
24
|
+
_Released 2026-11-09_
|
|
25
|
+
|
|
26
|
+
### Minor Changes
|
|
27
|
+
|
|
28
|
+
- b2bbbb4: New: code/* tokens color the syntax in `CodeBlock`.
|
|
29
|
+
|
|
30
|
+
- `code/keyword`, `code/string`, `code/function`, `code/constant`, `code/comment` and `code/punctuation`, each for Light and Dark.
|
|
31
|
+
- Every color reaches at least 4.5 : 1 on surface/subtle, surface/default and surface/brand-muted. The token build checks these pairs.
|
|
32
|
+
|
|
33
|
+
## 0.9.0
|
|
34
|
+
|
|
35
|
+
_Released 2026-11-08_
|
|
36
|
+
|
|
37
|
+
No changes in this release.
|
|
38
|
+
|
|
39
|
+
## 0.8.1
|
|
40
|
+
|
|
41
|
+
_Released 2026-11-08_
|
|
42
|
+
|
|
43
|
+
No changes in this release.
|
|
44
|
+
|
|
45
|
+
## 0.8.0
|
|
46
|
+
|
|
47
|
+
_Released 2026-11-07_
|
|
48
|
+
|
|
49
|
+
### Minor Changes
|
|
50
|
+
|
|
51
|
+
- ef97ec8: New: width tokens `size/width/3xs` to `size/width/6xl` (80 to 720 px).
|
|
52
|
+
|
|
53
|
+
- For what has a width of its own: floating layers, limits that cut long text and app regions. Components in the page take the width of their container.
|
|
54
|
+
- CSS `--medo-size-width-*`, JS and Figma variables; in Tailwind `max-w-(--medo-size-width-xl)`.
|
|
55
|
+
- Size tokens carry their Figma description.
|
|
56
|
+
|
|
57
|
+
## 0.7.2
|
|
58
|
+
|
|
59
|
+
_Released 2026-11-07_
|
|
60
|
+
|
|
61
|
+
No changes in this release.
|
|
62
|
+
|
|
63
|
+
## 0.7.1
|
|
64
|
+
|
|
65
|
+
_Released 2026-11-07_
|
|
66
|
+
|
|
67
|
+
No changes in this release.
|
|
68
|
+
|
|
69
|
+
## 0.7.0
|
|
70
|
+
|
|
71
|
+
_Released 2026-11-03_
|
|
72
|
+
|
|
73
|
+
No changes in this release.
|
|
74
|
+
|
|
75
|
+
## 0.6.0
|
|
76
|
+
|
|
77
|
+
_Released 2026-11-01_
|
|
78
|
+
|
|
79
|
+
### Patch Changes
|
|
80
|
+
|
|
81
|
+
- 3653bdb: Improved: the contrast check of the token build also covers higher contrast (`prefers-contrast: more`).
|
|
82
|
+
|
|
83
|
+
- Every allowed text / background pair is checked in that mode too.
|
|
84
|
+
- `docs/contrast.json` gets the values per mode (`light-more`, `dark-more`) and `higherContrast` – the lowest contrast of secondary text and borders on content surfaces.
|
|
85
|
+
|
|
86
|
+
## 0.5.1
|
|
87
|
+
|
|
88
|
+
_Released 2026-11-01_
|
|
89
|
+
|
|
90
|
+
No changes in this release.
|
|
91
|
+
|
|
92
|
+
## 0.5.0
|
|
93
|
+
|
|
94
|
+
_Released 2026-11-01_
|
|
95
|
+
|
|
96
|
+
### Minor Changes
|
|
97
|
+
|
|
98
|
+
- 2151054: New: fixed text / background pairs, checked in every build.
|
|
99
|
+
|
|
100
|
+
- `@med-o/design-tokens/docs/contrast.json` lists every allowed pair with its contrast in Light and Dark; the build fails below 4.5 : 1.
|
|
101
|
+
- The descriptions of `text/primary`, `text/secondary` and `border/strong` name the surfaces they are made for instead of “all surfaces”.
|
|
102
|
+
|
|
103
|
+
- 2151054: New: token `font/size/2xs` (11 px), used by `label/xs`.
|
|
104
|
+
|
|
105
|
+
For short metadata only.
|
|
106
|
+
|
|
107
|
+
## 0.4.2
|
|
108
|
+
|
|
109
|
+
_Released 2026-11-01_
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- 49f8981: Improved: the package README on npm covers the spacing rules and layout components.
|
|
114
|
+
|
|
115
|
+
Also supported browsers, versions and where to find the changelog.
|
|
116
|
+
|
|
117
|
+
## 0.4.1
|
|
118
|
+
|
|
119
|
+
_Released 2026-10-31_
|
|
120
|
+
|
|
121
|
+
## 0.4.0
|
|
122
|
+
|
|
123
|
+
_Released 2026-10-31_
|
|
124
|
+
|
|
125
|
+
### Minor Changes
|
|
126
|
+
|
|
127
|
+
- d1ca3a6: New: six spacing rules for the space between elements.
|
|
128
|
+
|
|
129
|
+
- `inline`, `content`, `fields`, `items`, `group`, `section` – as tokens `--medo-layout-gap-*` that follow the layout mode (mobile · tablet · desktop).
|
|
130
|
+
- As Tailwind utilities (`gap-items`, `space-y-fields`, `py-section` …) and as classes (`medo-gap-items`).
|
|
131
|
+
- `ButtonGroup` uses the rule `inline` (same value as before).
|
|
132
|
+
|
|
133
|
+
## 0.3.0
|
|
134
|
+
|
|
135
|
+
_Released 2026-10-30_
|
|
136
|
+
|
|
137
|
+
## 0.2.0
|
|
138
|
+
|
|
139
|
+
_Released 2026-10-28_
|
|
140
|
+
|
|
141
|
+
### Minor Changes
|
|
142
|
+
|
|
143
|
+
- be1add2: Improved: the overline text style is no longer uppercase.
|
|
144
|
+
|
|
145
|
+
Sentence case with normal tracking (`.medo-text-overline`, `--medo-typography-overline`); navigation section titles follow. Capitals are harder to read – write the text in the case you want to show.
|
|
146
|
+
|
|
147
|
+
- 23fbda6: Improved: higher contrast for “Increase contrast” in the system settings (`prefers-contrast: more`).
|
|
148
|
+
|
|
149
|
+
- `text/secondary` becomes neutral 700 (Light) or 300 (Dark): at least 9.4 : 1 on every surface.
|
|
150
|
+
- `border/default` becomes `border/strong`: at least 4.3 : 1.
|
|
151
|
+
- Works with `data-theme` on any element.
|
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ npm install @med-o/design-tokens
|
|
|
15
15
|
```css
|
|
16
16
|
@import "@med-o/design-tokens/css/tokens.css"; /* variables --medo-*, Light + Dark */
|
|
17
17
|
@import "@med-o/design-tokens/css/typography.css"; /* optional: .medo-text-* classes */
|
|
18
|
+
@import "@med-o/design-tokens/css/base.css"; /* optional: page reset and body styles, without Tailwind */
|
|
18
19
|
|
|
19
20
|
.card {
|
|
20
21
|
background: var(--medo-color-surface-raised);
|
|
@@ -44,6 +45,7 @@ Light and Dark follow the operating system. Force a theme with `data-theme="ligh
|
|
|
44
45
|
| --- | --- |
|
|
45
46
|
| `@med-o/design-tokens/css/tokens.css` | CSS variables, Light + Dark, responsive layout tokens (short form: `/css`) |
|
|
46
47
|
| `@med-o/design-tokens/css/typography.css` | Text style classes `.medo-text-*` |
|
|
48
|
+
| `@med-o/design-tokens/css/base.css` | Page base for apps without Tailwind: no browser margins, `border-box`, page colors and text style on `body` |
|
|
47
49
|
| `@med-o/design-tokens/tailwind/theme.css` | Tailwind v4 theme on top of the variables (short form: `/tailwind`) |
|
|
48
50
|
| `@med-o/design-tokens/js` | Resolved values and TypeScript types |
|
|
49
51
|
| `@med-o/design-tokens/src/*` | Source tokens in the DTCG format |
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Page base of the med.o Design System: a minimal reset and the page colors and text style from the tokens.
|
|
3
|
+
* For apps without Tailwind – its preflight resets the page already; with Tailwind this file is optional.
|
|
4
|
+
*
|
|
5
|
+
* @import "@med-o/design-tokens/css/tokens.css";
|
|
6
|
+
* @import "@med-o/design-tokens/css/base.css";
|
|
7
|
+
* @import "@med-o/ui/styles.css";
|
|
8
|
+
*
|
|
9
|
+
* Cascade layer `base`, in the same order as @med-o/ui and Tailwind v4: component styles, utilities and CSS without
|
|
10
|
+
* a layer (your app) always win over these rules, whatever the specificity.
|
|
11
|
+
*/
|
|
12
|
+
@layer theme, base, components, utilities;
|
|
13
|
+
|
|
14
|
+
@layer base {
|
|
15
|
+
/* Widths include padding and border, as in every component. No browser margins: the spacing rules set the gaps. */
|
|
16
|
+
*,
|
|
17
|
+
::before,
|
|
18
|
+
::after {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* The page follows Light and Dark through the tokens. */
|
|
24
|
+
body {
|
|
25
|
+
background: var(--medo-color-surface-canvas);
|
|
26
|
+
color: var(--medo-color-text-primary);
|
|
27
|
+
font: var(--medo-typography-body-md);
|
|
28
|
+
}
|
|
29
|
+
}
|
package/dist/css/tokens.css
CHANGED
|
@@ -206,6 +206,12 @@
|
|
|
206
206
|
--medo-color-text-inverse: var(--medo-color-white-0);
|
|
207
207
|
--medo-color-text-inverse-secondary: var(--medo-color-neutral-400);
|
|
208
208
|
--medo-color-text-on-media: var(--medo-color-white-0);
|
|
209
|
+
--medo-color-code-keyword: var(--medo-color-violet-700);
|
|
210
|
+
--medo-color-code-string: var(--medo-color-green-800);
|
|
211
|
+
--medo-color-code-function: var(--medo-color-sky-700);
|
|
212
|
+
--medo-color-code-constant: var(--medo-color-pink-700);
|
|
213
|
+
--medo-color-code-comment: var(--medo-color-neutral-600);
|
|
214
|
+
--medo-color-code-punctuation: var(--medo-color-neutral-700);
|
|
209
215
|
--medo-color-border-default: var(--medo-color-neutral-200);
|
|
210
216
|
--medo-color-border-strong: var(--medo-color-neutral-500);
|
|
211
217
|
--medo-color-border-strong-hover: var(--medo-color-neutral-600);
|
|
@@ -459,6 +465,12 @@
|
|
|
459
465
|
--medo-color-text-inverse: var(--medo-color-white-0);
|
|
460
466
|
--medo-color-text-inverse-secondary: var(--medo-color-neutral-400);
|
|
461
467
|
--medo-color-text-on-media: var(--medo-color-white-0);
|
|
468
|
+
--medo-color-code-keyword: var(--medo-color-violet-700);
|
|
469
|
+
--medo-color-code-string: var(--medo-color-green-800);
|
|
470
|
+
--medo-color-code-function: var(--medo-color-sky-700);
|
|
471
|
+
--medo-color-code-constant: var(--medo-color-pink-700);
|
|
472
|
+
--medo-color-code-comment: var(--medo-color-neutral-600);
|
|
473
|
+
--medo-color-code-punctuation: var(--medo-color-neutral-700);
|
|
462
474
|
--medo-color-border-default: var(--medo-color-neutral-200);
|
|
463
475
|
--medo-color-border-strong: var(--medo-color-neutral-500);
|
|
464
476
|
--medo-color-border-strong-hover: var(--medo-color-neutral-600);
|
|
@@ -560,6 +572,12 @@
|
|
|
560
572
|
--medo-color-text-inverse: var(--medo-color-neutral-900);
|
|
561
573
|
--medo-color-text-inverse-secondary: var(--medo-color-neutral-600);
|
|
562
574
|
--medo-color-text-on-media: var(--medo-color-white-0);
|
|
575
|
+
--medo-color-code-keyword: var(--medo-color-violet-300);
|
|
576
|
+
--medo-color-code-string: var(--medo-color-green-300);
|
|
577
|
+
--medo-color-code-function: var(--medo-color-sky-300);
|
|
578
|
+
--medo-color-code-constant: var(--medo-color-pink-300);
|
|
579
|
+
--medo-color-code-comment: var(--medo-color-neutral-400);
|
|
580
|
+
--medo-color-code-punctuation: var(--medo-color-neutral-300);
|
|
563
581
|
--medo-color-border-default: var(--medo-color-neutral-700);
|
|
564
582
|
--medo-color-border-strong: var(--medo-color-neutral-400);
|
|
565
583
|
--medo-color-border-strong-hover: var(--medo-color-neutral-300);
|
|
@@ -662,6 +680,12 @@
|
|
|
662
680
|
--medo-color-text-inverse: var(--medo-color-neutral-900);
|
|
663
681
|
--medo-color-text-inverse-secondary: var(--medo-color-neutral-600);
|
|
664
682
|
--medo-color-text-on-media: var(--medo-color-white-0);
|
|
683
|
+
--medo-color-code-keyword: var(--medo-color-violet-300);
|
|
684
|
+
--medo-color-code-string: var(--medo-color-green-300);
|
|
685
|
+
--medo-color-code-function: var(--medo-color-sky-300);
|
|
686
|
+
--medo-color-code-constant: var(--medo-color-pink-300);
|
|
687
|
+
--medo-color-code-comment: var(--medo-color-neutral-400);
|
|
688
|
+
--medo-color-code-punctuation: var(--medo-color-neutral-300);
|
|
665
689
|
--medo-color-border-default: var(--medo-color-neutral-700);
|
|
666
690
|
--medo-color-border-strong: var(--medo-color-neutral-400);
|
|
667
691
|
--medo-color-border-strong-hover: var(--medo-color-neutral-300);
|
package/dist/docs/contrast.json
CHANGED
|
@@ -648,6 +648,222 @@
|
|
|
648
648
|
}
|
|
649
649
|
}
|
|
650
650
|
]
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"name": "Code",
|
|
654
|
+
"use": "Syntax colors in Code block – on its surface, on the page and on a highlighted line.",
|
|
655
|
+
"pairs": [
|
|
656
|
+
{
|
|
657
|
+
"surface": "surface/subtle",
|
|
658
|
+
"text": "text/primary",
|
|
659
|
+
"contrast": {
|
|
660
|
+
"light": 16.28,
|
|
661
|
+
"dark": 13.97,
|
|
662
|
+
"light-more": 16.28,
|
|
663
|
+
"dark-more": 13.97
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
"surface": "surface/subtle",
|
|
668
|
+
"text": "code/keyword",
|
|
669
|
+
"contrast": {
|
|
670
|
+
"light": 6.66,
|
|
671
|
+
"dark": 7.88,
|
|
672
|
+
"light-more": 6.66,
|
|
673
|
+
"dark-more": 7.88
|
|
674
|
+
}
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
"surface": "surface/subtle",
|
|
678
|
+
"text": "code/string",
|
|
679
|
+
"contrast": {
|
|
680
|
+
"light": 6.51,
|
|
681
|
+
"dark": 10.43,
|
|
682
|
+
"light-more": 6.51,
|
|
683
|
+
"dark-more": 10.43
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"surface": "surface/subtle",
|
|
688
|
+
"text": "code/function",
|
|
689
|
+
"contrast": {
|
|
690
|
+
"light": 5.35,
|
|
691
|
+
"dark": 8.77,
|
|
692
|
+
"light-more": 5.35,
|
|
693
|
+
"dark-more": 8.77
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
"surface": "surface/subtle",
|
|
698
|
+
"text": "code/constant",
|
|
699
|
+
"contrast": {
|
|
700
|
+
"light": 5.39,
|
|
701
|
+
"dark": 8.02,
|
|
702
|
+
"light-more": 5.39,
|
|
703
|
+
"dark-more": 8.02
|
|
704
|
+
}
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
"surface": "surface/subtle",
|
|
708
|
+
"text": "code/comment",
|
|
709
|
+
"contrast": {
|
|
710
|
+
"light": 6.92,
|
|
711
|
+
"dark": 5.56,
|
|
712
|
+
"light-more": 6.92,
|
|
713
|
+
"dark-more": 5.56
|
|
714
|
+
}
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
"surface": "surface/subtle",
|
|
718
|
+
"text": "code/punctuation",
|
|
719
|
+
"contrast": {
|
|
720
|
+
"light": 9.45,
|
|
721
|
+
"dark": 9.83,
|
|
722
|
+
"light-more": 9.45,
|
|
723
|
+
"dark-more": 9.83
|
|
724
|
+
}
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"surface": "surface/default",
|
|
728
|
+
"text": "text/primary",
|
|
729
|
+
"contrast": {
|
|
730
|
+
"light": 17.83,
|
|
731
|
+
"dark": 17.04,
|
|
732
|
+
"light-more": 17.83,
|
|
733
|
+
"dark-more": 17.04
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"surface": "surface/default",
|
|
738
|
+
"text": "code/keyword",
|
|
739
|
+
"contrast": {
|
|
740
|
+
"light": 7.3,
|
|
741
|
+
"dark": 9.61,
|
|
742
|
+
"light-more": 7.3,
|
|
743
|
+
"dark-more": 9.61
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"surface": "surface/default",
|
|
748
|
+
"text": "code/string",
|
|
749
|
+
"contrast": {
|
|
750
|
+
"light": 7.13,
|
|
751
|
+
"dark": 12.73,
|
|
752
|
+
"light-more": 7.13,
|
|
753
|
+
"dark-more": 12.73
|
|
754
|
+
}
|
|
755
|
+
},
|
|
756
|
+
{
|
|
757
|
+
"surface": "surface/default",
|
|
758
|
+
"text": "code/function",
|
|
759
|
+
"contrast": {
|
|
760
|
+
"light": 5.86,
|
|
761
|
+
"dark": 10.7,
|
|
762
|
+
"light-more": 5.86,
|
|
763
|
+
"dark-more": 10.7
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
"surface": "surface/default",
|
|
768
|
+
"text": "code/constant",
|
|
769
|
+
"contrast": {
|
|
770
|
+
"light": 5.91,
|
|
771
|
+
"dark": 9.78,
|
|
772
|
+
"light-more": 5.91,
|
|
773
|
+
"dark-more": 9.78
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
{
|
|
777
|
+
"surface": "surface/default",
|
|
778
|
+
"text": "code/comment",
|
|
779
|
+
"contrast": {
|
|
780
|
+
"light": 7.58,
|
|
781
|
+
"dark": 6.78,
|
|
782
|
+
"light-more": 7.58,
|
|
783
|
+
"dark-more": 6.78
|
|
784
|
+
}
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
"surface": "surface/default",
|
|
788
|
+
"text": "code/punctuation",
|
|
789
|
+
"contrast": {
|
|
790
|
+
"light": 10.36,
|
|
791
|
+
"dark": 12,
|
|
792
|
+
"light-more": 10.36,
|
|
793
|
+
"dark-more": 12
|
|
794
|
+
}
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"surface": "surface/brand-muted",
|
|
798
|
+
"text": "text/primary",
|
|
799
|
+
"contrast": {
|
|
800
|
+
"light": 14.76,
|
|
801
|
+
"dark": 14.63,
|
|
802
|
+
"light-more": 14.76,
|
|
803
|
+
"dark-more": 14.63
|
|
804
|
+
}
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
"surface": "surface/brand-muted",
|
|
808
|
+
"text": "code/keyword",
|
|
809
|
+
"contrast": {
|
|
810
|
+
"light": 6.04,
|
|
811
|
+
"dark": 8.25,
|
|
812
|
+
"light-more": 6.04,
|
|
813
|
+
"dark-more": 8.25
|
|
814
|
+
}
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
"surface": "surface/brand-muted",
|
|
818
|
+
"text": "code/string",
|
|
819
|
+
"contrast": {
|
|
820
|
+
"light": 5.91,
|
|
821
|
+
"dark": 10.92,
|
|
822
|
+
"light-more": 5.91,
|
|
823
|
+
"dark-more": 10.92
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"surface": "surface/brand-muted",
|
|
828
|
+
"text": "code/function",
|
|
829
|
+
"contrast": {
|
|
830
|
+
"light": 4.85,
|
|
831
|
+
"dark": 9.18,
|
|
832
|
+
"light-more": 4.85,
|
|
833
|
+
"dark-more": 9.18
|
|
834
|
+
}
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
"surface": "surface/brand-muted",
|
|
838
|
+
"text": "code/constant",
|
|
839
|
+
"contrast": {
|
|
840
|
+
"light": 4.89,
|
|
841
|
+
"dark": 8.39,
|
|
842
|
+
"light-more": 4.89,
|
|
843
|
+
"dark-more": 8.39
|
|
844
|
+
}
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
"surface": "surface/brand-muted",
|
|
848
|
+
"text": "code/comment",
|
|
849
|
+
"contrast": {
|
|
850
|
+
"light": 6.28,
|
|
851
|
+
"dark": 5.82,
|
|
852
|
+
"light-more": 6.28,
|
|
853
|
+
"dark-more": 5.82
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
"surface": "surface/brand-muted",
|
|
858
|
+
"text": "code/punctuation",
|
|
859
|
+
"contrast": {
|
|
860
|
+
"light": 8.58,
|
|
861
|
+
"dark": 10.29,
|
|
862
|
+
"light-more": 8.58,
|
|
863
|
+
"dark-more": 10.29
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
]
|
|
651
867
|
}
|
|
652
868
|
]
|
|
653
869
|
}
|
|
@@ -376,6 +376,84 @@
|
|
|
376
376
|
"ref": "white/0",
|
|
377
377
|
"description": "Text and icons on top of images, always on overlay/media. White in both themes."
|
|
378
378
|
},
|
|
379
|
+
{
|
|
380
|
+
"name": "code/keyword",
|
|
381
|
+
"path": [
|
|
382
|
+
"color",
|
|
383
|
+
"code",
|
|
384
|
+
"keyword"
|
|
385
|
+
],
|
|
386
|
+
"type": "color",
|
|
387
|
+
"cssVar": "--medo-color-code-keyword",
|
|
388
|
+
"value": "#c4b4ff",
|
|
389
|
+
"ref": "violet/300",
|
|
390
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Keywords and tags (import, const, return, <div>). ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
"name": "code/string",
|
|
394
|
+
"path": [
|
|
395
|
+
"color",
|
|
396
|
+
"code",
|
|
397
|
+
"string"
|
|
398
|
+
],
|
|
399
|
+
"type": "color",
|
|
400
|
+
"cssVar": "--medo-color-code-string",
|
|
401
|
+
"value": "#7bf1a8",
|
|
402
|
+
"ref": "green/300",
|
|
403
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Strings and template text. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "code/function",
|
|
407
|
+
"path": [
|
|
408
|
+
"color",
|
|
409
|
+
"code",
|
|
410
|
+
"function"
|
|
411
|
+
],
|
|
412
|
+
"type": "color",
|
|
413
|
+
"cssVar": "--medo-color-code-function",
|
|
414
|
+
"value": "#74d4ff",
|
|
415
|
+
"ref": "sky/300",
|
|
416
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Function and component names. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"name": "code/constant",
|
|
420
|
+
"path": [
|
|
421
|
+
"color",
|
|
422
|
+
"code",
|
|
423
|
+
"constant"
|
|
424
|
+
],
|
|
425
|
+
"type": "color",
|
|
426
|
+
"cssVar": "--medo-color-code-constant",
|
|
427
|
+
"value": "#fda5d5",
|
|
428
|
+
"ref": "pink/300",
|
|
429
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Numbers, booleans, attributes and properties. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"name": "code/comment",
|
|
433
|
+
"path": [
|
|
434
|
+
"color",
|
|
435
|
+
"code",
|
|
436
|
+
"comment"
|
|
437
|
+
],
|
|
438
|
+
"type": "color",
|
|
439
|
+
"cssVar": "--medo-color-code-comment",
|
|
440
|
+
"value": "#90a1b9",
|
|
441
|
+
"ref": "neutral/400",
|
|
442
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Comments. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"name": "code/punctuation",
|
|
446
|
+
"path": [
|
|
447
|
+
"color",
|
|
448
|
+
"code",
|
|
449
|
+
"punctuation"
|
|
450
|
+
],
|
|
451
|
+
"type": "color",
|
|
452
|
+
"cssVar": "--medo-color-code-punctuation",
|
|
453
|
+
"value": "#cad5e2",
|
|
454
|
+
"ref": "neutral/300",
|
|
455
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Brackets, operators and separators. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
456
|
+
},
|
|
379
457
|
{
|
|
380
458
|
"name": "border/default",
|
|
381
459
|
"path": [
|
|
@@ -2290,6 +2290,84 @@
|
|
|
2290
2290
|
"ref": "white/0",
|
|
2291
2291
|
"description": "Text and icons on top of images, always on overlay/media. White in both themes."
|
|
2292
2292
|
},
|
|
2293
|
+
{
|
|
2294
|
+
"name": "code/keyword",
|
|
2295
|
+
"path": [
|
|
2296
|
+
"color",
|
|
2297
|
+
"code",
|
|
2298
|
+
"keyword"
|
|
2299
|
+
],
|
|
2300
|
+
"type": "color",
|
|
2301
|
+
"cssVar": "--medo-color-code-keyword",
|
|
2302
|
+
"value": "#7008e7",
|
|
2303
|
+
"ref": "violet/700",
|
|
2304
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Keywords and tags (import, const, return, <div>). ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
2305
|
+
},
|
|
2306
|
+
{
|
|
2307
|
+
"name": "code/string",
|
|
2308
|
+
"path": [
|
|
2309
|
+
"color",
|
|
2310
|
+
"code",
|
|
2311
|
+
"string"
|
|
2312
|
+
],
|
|
2313
|
+
"type": "color",
|
|
2314
|
+
"cssVar": "--medo-color-code-string",
|
|
2315
|
+
"value": "#016630",
|
|
2316
|
+
"ref": "green/800",
|
|
2317
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Strings and template text. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
2318
|
+
},
|
|
2319
|
+
{
|
|
2320
|
+
"name": "code/function",
|
|
2321
|
+
"path": [
|
|
2322
|
+
"color",
|
|
2323
|
+
"code",
|
|
2324
|
+
"function"
|
|
2325
|
+
],
|
|
2326
|
+
"type": "color",
|
|
2327
|
+
"cssVar": "--medo-color-code-function",
|
|
2328
|
+
"value": "#0069a8",
|
|
2329
|
+
"ref": "sky/700",
|
|
2330
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Function and component names. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
2331
|
+
},
|
|
2332
|
+
{
|
|
2333
|
+
"name": "code/constant",
|
|
2334
|
+
"path": [
|
|
2335
|
+
"color",
|
|
2336
|
+
"code",
|
|
2337
|
+
"constant"
|
|
2338
|
+
],
|
|
2339
|
+
"type": "color",
|
|
2340
|
+
"cssVar": "--medo-color-code-constant",
|
|
2341
|
+
"value": "#c6005c",
|
|
2342
|
+
"ref": "pink/700",
|
|
2343
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Numbers, booleans, attributes and properties. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
2344
|
+
},
|
|
2345
|
+
{
|
|
2346
|
+
"name": "code/comment",
|
|
2347
|
+
"path": [
|
|
2348
|
+
"color",
|
|
2349
|
+
"code",
|
|
2350
|
+
"comment"
|
|
2351
|
+
],
|
|
2352
|
+
"type": "color",
|
|
2353
|
+
"cssVar": "--medo-color-code-comment",
|
|
2354
|
+
"value": "#45556c",
|
|
2355
|
+
"ref": "neutral/600",
|
|
2356
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Comments. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
2357
|
+
},
|
|
2358
|
+
{
|
|
2359
|
+
"name": "code/punctuation",
|
|
2360
|
+
"path": [
|
|
2361
|
+
"color",
|
|
2362
|
+
"code",
|
|
2363
|
+
"punctuation"
|
|
2364
|
+
],
|
|
2365
|
+
"type": "color",
|
|
2366
|
+
"cssVar": "--medo-color-code-punctuation",
|
|
2367
|
+
"value": "#314158",
|
|
2368
|
+
"ref": "neutral/700",
|
|
2369
|
+
"description": "Syntax highlighting in Code block on surface/subtle and surface/default: Brackets, operators and separators. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
2370
|
+
},
|
|
2293
2371
|
{
|
|
2294
2372
|
"name": "border/default",
|
|
2295
2373
|
"path": [
|
package/dist/js/tokens.js
CHANGED
|
@@ -197,6 +197,12 @@ export const tokens = {
|
|
|
197
197
|
"color-text-inverse": "#ffffff",
|
|
198
198
|
"color-text-inverse-secondary": "#90a1b9",
|
|
199
199
|
"color-text-on-media": "#ffffff",
|
|
200
|
+
"color-code-keyword": "#7008e7",
|
|
201
|
+
"color-code-string": "#016630",
|
|
202
|
+
"color-code-function": "#0069a8",
|
|
203
|
+
"color-code-constant": "#c6005c",
|
|
204
|
+
"color-code-comment": "#45556c",
|
|
205
|
+
"color-code-punctuation": "#314158",
|
|
200
206
|
"color-border-default": "#e2e8f0",
|
|
201
207
|
"color-border-strong": "#62748e",
|
|
202
208
|
"color-border-strong-hover": "#45556c",
|
|
@@ -449,6 +455,12 @@ export const darkColors = {
|
|
|
449
455
|
"color-text-inverse": "#0f172b",
|
|
450
456
|
"color-text-inverse-secondary": "#45556c",
|
|
451
457
|
"color-text-on-media": "#ffffff",
|
|
458
|
+
"color-code-keyword": "#c4b4ff",
|
|
459
|
+
"color-code-string": "#7bf1a8",
|
|
460
|
+
"color-code-function": "#74d4ff",
|
|
461
|
+
"color-code-constant": "#fda5d5",
|
|
462
|
+
"color-code-comment": "#90a1b9",
|
|
463
|
+
"color-code-punctuation": "#cad5e2",
|
|
452
464
|
"color-border-default": "#314158",
|
|
453
465
|
"color-border-strong": "#90a1b9",
|
|
454
466
|
"color-border-strong-hover": "#cad5e2",
|
package/dist/tailwind/theme.css
CHANGED
|
@@ -45,6 +45,12 @@
|
|
|
45
45
|
--color-text-inverse: var(--medo-color-text-inverse);
|
|
46
46
|
--color-text-inverse-secondary: var(--medo-color-text-inverse-secondary);
|
|
47
47
|
--color-text-on-media: var(--medo-color-text-on-media);
|
|
48
|
+
--color-code-keyword: var(--medo-color-code-keyword);
|
|
49
|
+
--color-code-string: var(--medo-color-code-string);
|
|
50
|
+
--color-code-function: var(--medo-color-code-function);
|
|
51
|
+
--color-code-constant: var(--medo-color-code-constant);
|
|
52
|
+
--color-code-comment: var(--medo-color-code-comment);
|
|
53
|
+
--color-code-punctuation: var(--medo-color-code-punctuation);
|
|
48
54
|
--color-border-default: var(--medo-color-border-default);
|
|
49
55
|
--color-border-strong: var(--medo-color-border-strong);
|
|
50
56
|
--color-border-strong-hover: var(--medo-color-border-strong-hover);
|
package/package.json
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@med-o/design-tokens",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Design tokens of the med.o Design System (DTCG source, CSS variables, Tailwind v4 theme, JS).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
|
-
"src"
|
|
9
|
+
"src",
|
|
10
|
+
"CHANGELOG.md"
|
|
10
11
|
],
|
|
11
12
|
"exports": {
|
|
12
13
|
"./css": "./dist/css/tokens.css",
|
|
13
14
|
"./css/tokens.css": "./dist/css/tokens.css",
|
|
14
15
|
"./css/typography.css": "./dist/css/typography.css",
|
|
16
|
+
"./css/base.css": "./dist/css/base.css",
|
|
15
17
|
"./tailwind": "./dist/tailwind/theme.css",
|
|
16
18
|
"./tailwind/theme.css": "./dist/tailwind/theme.css",
|
|
17
19
|
"./js": {
|
package/src/color/dark.json
CHANGED
|
@@ -153,6 +153,38 @@
|
|
|
153
153
|
"$description": "Text and icons on top of images, always on overlay/media. White in both themes."
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
|
+
"code": {
|
|
157
|
+
"keyword": {
|
|
158
|
+
"$type": "color",
|
|
159
|
+
"$value": "{color.violet.300}",
|
|
160
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Keywords and tags (import, const, return, <div>). ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
161
|
+
},
|
|
162
|
+
"string": {
|
|
163
|
+
"$type": "color",
|
|
164
|
+
"$value": "{color.green.300}",
|
|
165
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Strings and template text. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
166
|
+
},
|
|
167
|
+
"function": {
|
|
168
|
+
"$type": "color",
|
|
169
|
+
"$value": "{color.sky.300}",
|
|
170
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Function and component names. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
171
|
+
},
|
|
172
|
+
"constant": {
|
|
173
|
+
"$type": "color",
|
|
174
|
+
"$value": "{color.pink.300}",
|
|
175
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Numbers, booleans, attributes and properties. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
176
|
+
},
|
|
177
|
+
"comment": {
|
|
178
|
+
"$type": "color",
|
|
179
|
+
"$value": "{color.neutral.400}",
|
|
180
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Comments. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
181
|
+
},
|
|
182
|
+
"punctuation": {
|
|
183
|
+
"$type": "color",
|
|
184
|
+
"$value": "{color.neutral.300}",
|
|
185
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Brackets, operators and separators. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
186
|
+
}
|
|
187
|
+
},
|
|
156
188
|
"border": {
|
|
157
189
|
"default": {
|
|
158
190
|
"$type": "color",
|
package/src/color/light.json
CHANGED
|
@@ -153,6 +153,38 @@
|
|
|
153
153
|
"$description": "Text and icons on top of images, always on overlay/media. White in both themes."
|
|
154
154
|
}
|
|
155
155
|
},
|
|
156
|
+
"code": {
|
|
157
|
+
"keyword": {
|
|
158
|
+
"$type": "color",
|
|
159
|
+
"$value": "{color.violet.700}",
|
|
160
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Keywords and tags (import, const, return, <div>). ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
161
|
+
},
|
|
162
|
+
"string": {
|
|
163
|
+
"$type": "color",
|
|
164
|
+
"$value": "{color.green.800}",
|
|
165
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Strings and template text. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
166
|
+
},
|
|
167
|
+
"function": {
|
|
168
|
+
"$type": "color",
|
|
169
|
+
"$value": "{color.sky.700}",
|
|
170
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Function and component names. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
171
|
+
},
|
|
172
|
+
"constant": {
|
|
173
|
+
"$type": "color",
|
|
174
|
+
"$value": "{color.pink.700}",
|
|
175
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Numbers, booleans, attributes and properties. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
176
|
+
},
|
|
177
|
+
"comment": {
|
|
178
|
+
"$type": "color",
|
|
179
|
+
"$value": "{color.neutral.600}",
|
|
180
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Comments. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
181
|
+
},
|
|
182
|
+
"punctuation": {
|
|
183
|
+
"$type": "color",
|
|
184
|
+
"$value": "{color.neutral.700}",
|
|
185
|
+
"$description": "Syntax highlighting in Code block on surface/subtle and surface/default: Brackets, operators and separators. ≥ 4.5:1 in both modes. Plain code uses text/primary."
|
|
186
|
+
}
|
|
187
|
+
},
|
|
156
188
|
"border": {
|
|
157
189
|
"default": {
|
|
158
190
|
"$type": "color",
|
package/src/css/base.css
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Page base of the med.o Design System: a minimal reset and the page colors and text style from the tokens.
|
|
3
|
+
* For apps without Tailwind – its preflight resets the page already; with Tailwind this file is optional.
|
|
4
|
+
*
|
|
5
|
+
* @import "@med-o/design-tokens/css/tokens.css";
|
|
6
|
+
* @import "@med-o/design-tokens/css/base.css";
|
|
7
|
+
* @import "@med-o/ui/styles.css";
|
|
8
|
+
*
|
|
9
|
+
* Cascade layer `base`, in the same order as @med-o/ui and Tailwind v4: component styles, utilities and CSS without
|
|
10
|
+
* a layer (your app) always win over these rules, whatever the specificity.
|
|
11
|
+
*/
|
|
12
|
+
@layer theme, base, components, utilities;
|
|
13
|
+
|
|
14
|
+
@layer base {
|
|
15
|
+
/* Widths include padding and border, as in every component. No browser margins: the spacing rules set the gaps. */
|
|
16
|
+
*,
|
|
17
|
+
::before,
|
|
18
|
+
::after {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
margin: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* The page follows Light and Dark through the tokens. */
|
|
24
|
+
body {
|
|
25
|
+
background: var(--medo-color-surface-canvas);
|
|
26
|
+
color: var(--medo-color-text-primary);
|
|
27
|
+
font: var(--medo-typography-body-md);
|
|
28
|
+
}
|
|
29
|
+
}
|