@orange-halo/tokens 2.0.0 → 2.2.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/contrast-pairs.json +187 -30
- package/contrast.js +11 -2
- package/dist/brands/hood-dark.css +74 -0
- package/dist/brands/hood-dark.json +723 -0
- package/dist/brands/hood.css +434 -0
- package/dist/brands/hood.json +723 -0
- package/dist/brands/orange-halo-dark.css +78 -0
- package/dist/brands/orange-halo-dark.json +857 -0
- package/dist/brands/orange-halo.css +512 -0
- package/dist/brands/orange-halo.json +857 -0
- package/dist/themes/dark.css +11 -0
- package/dist/themes/dark.json +146 -72
- package/dist/tokens.css +113 -62
- package/dist/tokens.js +131 -64
- package/dist/tokens.json +146 -72
- package/package.json +3 -4
- package/tokens/brands/hood/brand.json +7 -0
- package/tokens/brands/hood/dark.tokens.json +295 -0
- package/tokens/brands/hood/light.tokens.json +875 -0
- package/tokens/brands/hood/palette.tokens.json +187 -0
- package/tokens/brands/orange-halo/brand.json +7 -0
- package/tokens/{themes → brands/orange-halo}/dark.tokens.json +57 -7
- package/tokens/{semantic.tokens.json → brands/orange-halo/light.tokens.json} +128 -3
- package/tokens/{global.tokens.json → brands/orange-halo/palette.tokens.json} +83 -205
- package/tokens/{component.tokens.json → core/component.tokens.json} +205 -51
- package/tokens/core/scales.tokens.json +170 -0
- package/dist/themes/light.css +0 -47
package/contrast-pairs.json
CHANGED
|
@@ -1,35 +1,192 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$description": "Token pairs that must meet WCAG contrast. Used by `pnpm check:contrast` and the Storybook Tokens page. Paths are token paths in dist/tokens.json. `over` composites a translucent background onto a solid one. `knownIssue` reports a failure as a warning until it's resolved.",
|
|
3
3
|
"pairs": [
|
|
4
|
-
{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
4
|
+
{
|
|
5
|
+
"fg": "color.text.primary",
|
|
6
|
+
"bg": "color.surface.base",
|
|
7
|
+
"min": 4.5,
|
|
8
|
+
"use": "Body text on page"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"fg": "color.text.primary",
|
|
12
|
+
"bg": "color.surface.raised",
|
|
13
|
+
"min": 4.5,
|
|
14
|
+
"use": "Body text on cards"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"fg": "color.text.secondary",
|
|
18
|
+
"bg": "color.surface.base",
|
|
19
|
+
"min": 4.5,
|
|
20
|
+
"use": "Secondary text on page"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"fg": "color.text.secondary",
|
|
24
|
+
"bg": "color.surface.inset",
|
|
25
|
+
"min": 4.5,
|
|
26
|
+
"use": "Placeholder / helper text in wells"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"fg": "color.text.secondary",
|
|
30
|
+
"bg": "color.surface.raised",
|
|
31
|
+
"min": 4.5,
|
|
32
|
+
"use": "Secondary text on raised surfaces (cards, panels, keyboard hints)"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"fg": "color.text.primary",
|
|
36
|
+
"bg": "color.surface.highlight",
|
|
37
|
+
"min": 4.5,
|
|
38
|
+
"use": "Text in a focused input"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"fg": "color.text.link",
|
|
42
|
+
"bg": "color.surface.base",
|
|
43
|
+
"min": 4.5,
|
|
44
|
+
"use": "Links on page"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"fg": "color.text.linkRaised",
|
|
48
|
+
"bg": "color.surface.raised",
|
|
49
|
+
"min": 4.5,
|
|
50
|
+
"use": "Links on raised surfaces (cards, skip link)"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"fg": "color.text.onBrand",
|
|
54
|
+
"bg": "color.brand.primary",
|
|
55
|
+
"min": 4.5,
|
|
56
|
+
"use": "Primary button, hero text"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"fg": "color.text.onBrand",
|
|
60
|
+
"bg": "color.brand.primaryHover",
|
|
61
|
+
"min": 4.5,
|
|
62
|
+
"use": "Primary button hover"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"fg": "color.text.onAccent",
|
|
66
|
+
"bg": "color.accent.default",
|
|
67
|
+
"min": 4.5,
|
|
68
|
+
"use": "Accent button, footer text"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"fg": "color.text.onAccent",
|
|
72
|
+
"bg": "color.accent.hover",
|
|
73
|
+
"min": 4.5,
|
|
74
|
+
"use": "Accent button hover"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"fg": "color.brand.primary",
|
|
78
|
+
"bg": "color.brand.primarySubtle",
|
|
79
|
+
"min": 4.5,
|
|
80
|
+
"use": "Brand badge"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"fg": "color.accent.default",
|
|
84
|
+
"bg": "color.accent.subtle",
|
|
85
|
+
"min": 4.5,
|
|
86
|
+
"use": "Accent badge"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"fg": "color.feedback.success",
|
|
90
|
+
"bg": "color.feedback.successSubtle",
|
|
91
|
+
"min": 4.5,
|
|
92
|
+
"use": "Success badge / alert text"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"fg": "color.feedback.error",
|
|
96
|
+
"bg": "color.feedback.errorSubtle",
|
|
97
|
+
"min": 4.5,
|
|
98
|
+
"use": "Error text on error background"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"fg": "color.feedback.error",
|
|
102
|
+
"bg": "color.surface.base",
|
|
103
|
+
"min": 4.5,
|
|
104
|
+
"use": "Error messages"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"fg": "color.feedback.warning",
|
|
108
|
+
"bg": "color.feedback.warningSubtle",
|
|
109
|
+
"min": 4.5,
|
|
110
|
+
"use": "Warning badge / alert text"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"fg": "color.feedback.info",
|
|
114
|
+
"bg": "color.feedback.infoSubtle",
|
|
115
|
+
"min": 4.5,
|
|
116
|
+
"use": "Info badge / alert text"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"fg": "color.text.onSuccess",
|
|
120
|
+
"bg": "color.feedback.success",
|
|
121
|
+
"min": 4.5,
|
|
122
|
+
"use": "Filled success badge"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"fg": "color.text.onError",
|
|
126
|
+
"bg": "color.feedback.error",
|
|
127
|
+
"min": 4.5,
|
|
128
|
+
"use": "Filled error badge"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"fg": "color.text.onWarning",
|
|
132
|
+
"bg": "color.feedback.warning",
|
|
133
|
+
"min": 4.5,
|
|
134
|
+
"use": "Filled warning badge"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"fg": "color.text.onInfo",
|
|
138
|
+
"bg": "color.feedback.info",
|
|
139
|
+
"min": 4.5,
|
|
140
|
+
"use": "Filled info badge"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"fg": "color.border.emphasis",
|
|
144
|
+
"bg": "color.surface.base",
|
|
145
|
+
"min": 3,
|
|
146
|
+
"use": "Control borders at rest"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"fg": "color.border.hover",
|
|
150
|
+
"bg": "color.surface.base",
|
|
151
|
+
"min": 3,
|
|
152
|
+
"use": "Control borders on hover"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"fg": "focus.ringColor",
|
|
156
|
+
"bg": "color.surface.highlight",
|
|
157
|
+
"min": 3,
|
|
158
|
+
"use": "Focused input border"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"fg": "focus.ringColor",
|
|
162
|
+
"bg": "color.surface.base",
|
|
163
|
+
"min": 3,
|
|
164
|
+
"use": "Focus outline"
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"fg": "color.brand.primary",
|
|
168
|
+
"bg": "color.surface.base",
|
|
169
|
+
"min": 3,
|
|
170
|
+
"use": "Checked controls, link underlines"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"fg": "color.feedback.success",
|
|
174
|
+
"bg": "color.surface.inset",
|
|
175
|
+
"min": 3,
|
|
176
|
+
"use": "Progress fill (success)"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"fg": "color.brand.primary",
|
|
180
|
+
"bg": "color.surface.inset",
|
|
181
|
+
"min": 3,
|
|
182
|
+
"use": "Progress fill (brand)"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"fg": "progress.inverse.fill",
|
|
186
|
+
"bg": "progress.inverse.trackBackground",
|
|
187
|
+
"over": "color.brand.primary",
|
|
188
|
+
"min": 3,
|
|
189
|
+
"use": "Inverse progress fill in the hero"
|
|
190
|
+
}
|
|
34
191
|
]
|
|
35
192
|
}
|
package/contrast.js
CHANGED
|
@@ -24,7 +24,12 @@ export function parseColor(value) {
|
|
|
24
24
|
/** Alpha-composite a colour onto an opaque background. */
|
|
25
25
|
export function composite(fg, bg) {
|
|
26
26
|
const [r, g, b, a] = fg;
|
|
27
|
-
return [
|
|
27
|
+
return [
|
|
28
|
+
r * a + bg[0] * (1 - a),
|
|
29
|
+
g * a + bg[1] * (1 - a),
|
|
30
|
+
b * a + bg[2] * (1 - a),
|
|
31
|
+
1,
|
|
32
|
+
];
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
function luminance([r, g, b]) {
|
|
@@ -55,5 +60,9 @@ export function checkPair(tokens, pair) {
|
|
|
55
60
|
let fg = parseColor(resolve(tokens, pair.fg));
|
|
56
61
|
if (fg[3] < 1) fg = composite(fg, bg);
|
|
57
62
|
const value = ratio(fg, bg);
|
|
58
|
-
return {
|
|
63
|
+
return {
|
|
64
|
+
...pair,
|
|
65
|
+
ratio: Math.round(value * 100) / 100,
|
|
66
|
+
pass: value >= pair.min,
|
|
67
|
+
};
|
|
59
68
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
[data-theme='dark'] {
|
|
6
|
+
--oh-color-surface-overlay: rgba(0, 0, 0, 0.7);
|
|
7
|
+
--oh-color-surface-sheen: rgba(255, 255, 255, 0.03);
|
|
8
|
+
--oh-color-surface-backdrop: rgba(0, 0, 0, 0.75);
|
|
9
|
+
--oh-color-border-brand: rgba(255, 255, 255, 0.25);
|
|
10
|
+
--oh-color-border-brand-hover: rgba(255, 255, 255, 0.45);
|
|
11
|
+
--oh-focus-glow-color: rgba(255, 255, 255, 0); /** No glow: the outline is the indicator */
|
|
12
|
+
--oh-color-brand-primary: var(--oh-color-white);
|
|
13
|
+
--oh-color-brand-primary-hover: var(--oh-color-grey-200);
|
|
14
|
+
--oh-color-brand-primary-active: var(--oh-color-grey-300);
|
|
15
|
+
--oh-color-brand-primary-subtle: var(--oh-color-grey-800);
|
|
16
|
+
--oh-color-brand-highlight: var(--oh-color-grey-100);
|
|
17
|
+
--oh-color-brand-highlight-subtle: var(--oh-color-grey-750);
|
|
18
|
+
--oh-color-accent-default: var(--oh-color-blue-300);
|
|
19
|
+
--oh-color-accent-hover: var(--oh-color-blue-200);
|
|
20
|
+
--oh-color-accent-active: var(--oh-color-blue-300);
|
|
21
|
+
--oh-color-accent-subtle: var(--oh-color-blue-900);
|
|
22
|
+
--oh-color-accent-shadow: var(--oh-color-blue-900);
|
|
23
|
+
--oh-color-feedback-success: var(--oh-color-green-300);
|
|
24
|
+
--oh-color-feedback-success-subtle: var(--oh-color-green-900);
|
|
25
|
+
--oh-color-feedback-error: var(--oh-color-red-300);
|
|
26
|
+
--oh-color-feedback-error-hover: var(--oh-color-red-100);
|
|
27
|
+
--oh-color-feedback-error-subtle: var(--oh-color-red-900);
|
|
28
|
+
--oh-color-feedback-error-shadow: var(--oh-color-red-900);
|
|
29
|
+
--oh-color-feedback-warning: var(--oh-color-amber-300);
|
|
30
|
+
--oh-color-feedback-warning-subtle: var(--oh-color-amber-900);
|
|
31
|
+
--oh-color-feedback-info: var(--oh-color-blue-300);
|
|
32
|
+
--oh-color-feedback-info-subtle: var(--oh-color-blue-900);
|
|
33
|
+
--oh-color-surface-base: var(--oh-color-grey-850);
|
|
34
|
+
--oh-color-surface-raised: var(--oh-color-grey-800);
|
|
35
|
+
--oh-color-surface-sunlit: var(--oh-color-grey-800);
|
|
36
|
+
--oh-color-surface-inset: var(--oh-color-grey-900);
|
|
37
|
+
--oh-color-surface-highlight: var(--oh-color-grey-750);
|
|
38
|
+
--oh-color-surface-disabled: var(--oh-color-grey-800);
|
|
39
|
+
--oh-color-surface-hover: var(--oh-color-grey-750);
|
|
40
|
+
--oh-color-surface-active-pressed: var(--oh-color-grey-700);
|
|
41
|
+
--oh-color-surface-featured-start: var(--oh-color-grey-750);
|
|
42
|
+
--oh-color-surface-featured-mid: var(--oh-color-grey-800);
|
|
43
|
+
--oh-color-surface-featured-end: var(--oh-color-grey-800);
|
|
44
|
+
--oh-color-border-default: var(--oh-color-grey-750);
|
|
45
|
+
--oh-color-border-subtle: var(--oh-color-grey-800);
|
|
46
|
+
--oh-color-border-emphasis: var(--oh-color-grey-500);
|
|
47
|
+
--oh-color-border-strong: var(--oh-color-grey-650);
|
|
48
|
+
--oh-color-border-hover: var(--oh-color-grey-100);
|
|
49
|
+
--oh-color-border-disabled: var(--oh-color-grey-800);
|
|
50
|
+
--oh-color-border-divider: var(--oh-color-grey-750);
|
|
51
|
+
--oh-color-text-primary: var(--oh-color-grey-100);
|
|
52
|
+
--oh-color-text-secondary: var(--oh-color-grey-500);
|
|
53
|
+
--oh-color-text-disabled: var(--oh-color-grey-650);
|
|
54
|
+
--oh-color-text-inverse: var(--oh-color-grey-850);
|
|
55
|
+
--oh-color-text-link: var(--oh-color-white);
|
|
56
|
+
--oh-color-text-link-hover: var(--oh-color-grey-300);
|
|
57
|
+
--oh-color-text-link-raised: var(--oh-color-white);
|
|
58
|
+
--oh-color-text-brand: var(--oh-color-white);
|
|
59
|
+
--oh-color-text-on-brand: var(--oh-color-grey-850);
|
|
60
|
+
--oh-color-text-on-accent: var(--oh-color-grey-850);
|
|
61
|
+
--oh-color-text-on-success: var(--oh-color-grey-850);
|
|
62
|
+
--oh-color-text-on-error: var(--oh-color-grey-850);
|
|
63
|
+
--oh-color-text-on-warning: var(--oh-color-grey-850);
|
|
64
|
+
--oh-color-text-on-info: var(--oh-color-grey-850);
|
|
65
|
+
--oh-shadow-overlay: var(--oh-color-black);
|
|
66
|
+
--oh-shadow-primary: var(--oh-color-black);
|
|
67
|
+
--oh-shadow-secondary: var(--oh-color-black);
|
|
68
|
+
--oh-shadow-accent: var(--oh-color-black);
|
|
69
|
+
--oh-shadow-error: var(--oh-color-black);
|
|
70
|
+
--oh-shadow-neutral: var(--oh-color-black);
|
|
71
|
+
--oh-shadow-neutral-hover: var(--oh-color-black);
|
|
72
|
+
--oh-shadow-field: var(--oh-color-black);
|
|
73
|
+
--oh-focus-ring-color: var(--oh-color-white); /** Solid focus outline, as on the site: white on dark, near-black on light */
|
|
74
|
+
}
|