@datalayer/primer-addons 1.0.25 → 1.0.27
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/lib/theme/colors/loopColors.d.ts +9 -5
- package/lib/theme/colors/loopColors.js +27 -22
- package/lib/theme/css/createThemeCSSVars.d.ts +8 -0
- package/lib/theme/css/createThemeCSSVars.js +8 -0
- package/lib/theme/themes/loopTheme.d.ts +27 -5
- package/lib/theme/themes/loopTheme.js +126 -56
- package/package.json +1 -1
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
* and a single soft accent that dark text sits on. Nothing else carries
|
|
7
7
|
* colour, apart from the three colours of a verdict.
|
|
8
8
|
*
|
|
9
|
-
* The accent of the theme itself is
|
|
10
|
-
*
|
|
11
|
-
* (
|
|
12
|
-
*
|
|
9
|
+
* The accent of the theme itself is sky — a soft blue of LOOP's own,
|
|
10
|
+
* so that an application never looks like the platform that built it
|
|
11
|
+
* (decided 2026-10-03; it was Datalayer's green until then). An
|
|
12
|
+
* application may take one of five others (`loopAccents`), the platform's
|
|
13
|
+
* green among them; each is four values: the accent, the text that sits
|
|
14
|
+
* on it, the tint of the stage behind an application, and a quiet tint.
|
|
13
15
|
* Dark text on every accent: the lowest contrast of the six is 8.8 to 1.
|
|
14
16
|
*/
|
|
15
17
|
export declare const loopColors: {
|
|
@@ -25,6 +27,8 @@ export declare const loopColors: {
|
|
|
25
27
|
loopOn: string;
|
|
26
28
|
loopAccent: string;
|
|
27
29
|
loopText: string;
|
|
30
|
+
loopEmphasis: string;
|
|
31
|
+
loopEmphasisHover: string;
|
|
28
32
|
loopTint: string;
|
|
29
33
|
loopStage: string;
|
|
30
34
|
loopBright: string;
|
|
@@ -80,7 +84,7 @@ export interface LoopAccent {
|
|
|
80
84
|
dark: string;
|
|
81
85
|
};
|
|
82
86
|
}
|
|
83
|
-
/** The six accents. One per application; everything else is neutral. */
|
|
87
|
+
/** The six accents. One per application; everything else is neutral. Sky is the theme's own. */
|
|
84
88
|
export declare const loopAccents: Record<LoopAccentName, LoopAccent>;
|
|
85
89
|
/** The names of the accents, in the order a picker shows them. */
|
|
86
90
|
export declare const loopAccentNames: LoopAccentName[];
|
|
@@ -10,35 +10,40 @@
|
|
|
10
10
|
* and a single soft accent that dark text sits on. Nothing else carries
|
|
11
11
|
* colour, apart from the three colours of a verdict.
|
|
12
12
|
*
|
|
13
|
-
* The accent of the theme itself is
|
|
14
|
-
*
|
|
15
|
-
* (
|
|
16
|
-
*
|
|
13
|
+
* The accent of the theme itself is sky — a soft blue of LOOP's own,
|
|
14
|
+
* so that an application never looks like the platform that built it
|
|
15
|
+
* (decided 2026-10-03; it was Datalayer's green until then). An
|
|
16
|
+
* application may take one of five others (`loopAccents`), the platform's
|
|
17
|
+
* green among them; each is four values: the accent, the text that sits
|
|
18
|
+
* on it, the tint of the stage behind an application, and a quiet tint.
|
|
17
19
|
* Dark text on every accent: the lowest contrast of the six is 8.8 to 1.
|
|
18
20
|
*/
|
|
19
21
|
export const loopColors = {
|
|
20
22
|
// Core neutrals
|
|
21
23
|
black: '#131314', // Near-black — primary dark background
|
|
22
|
-
gray: '#
|
|
24
|
+
gray: '#6E6E73', // Secondary text on light: a soft grey, 5.1 to 1 on white
|
|
23
25
|
white: '#FFFFFF', // White — primary light background
|
|
24
|
-
// Neutral surfaces and ink
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
// Neutral surfaces and ink. The ink is not black: a deep grey with a
|
|
27
|
+
// breath of blue, as a page of a well-set book reads — 16.8 to 1 on white.
|
|
28
|
+
ink: '#1D1D1F', // Text on light
|
|
29
|
+
inkDark: '#F5F5F7', // Text on dark
|
|
30
|
+
subtle: '#F5F5F7', // Subtle surface on light (a bubble, a chip)
|
|
28
31
|
subtleDark: '#1E1E20', // Subtle surface on dark
|
|
29
|
-
grayDark: '#
|
|
30
|
-
// Loop palette (Brand) —
|
|
31
|
-
loopBrand: '#
|
|
32
|
-
loopOn: '#
|
|
33
|
-
loopAccent: '#
|
|
34
|
-
loopText: '#
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
grayDark: '#A1A1A6', // Secondary text on dark
|
|
33
|
+
// Loop palette (Brand) — sky
|
|
34
|
+
loopBrand: '#8CCBF9', // The accent — a bubble, a send button, a swatch
|
|
35
|
+
loopOn: '#06243B', // Text that sits on the accent (9.1 to 1)
|
|
36
|
+
loopAccent: '#5DB3F5', // Deeper accent — charts, highlights
|
|
37
|
+
loopText: '#175FA8', // Accessible accent text & links on white (6.5 to 1)
|
|
38
|
+
loopEmphasis: '#1B5FBF', // The one filled button, and the person's bubble: white text, 6.1 to 1
|
|
39
|
+
loopEmphasisHover: '#175FA8', // The same, pressed
|
|
40
|
+
loopTint: '#F0F8FE', // Quiet tint — a draft, a callout
|
|
41
|
+
loopStage: '#DFF0FD', // The stage behind an application
|
|
42
|
+
loopBright: '#9DD3FA', // Accent text & links on dark
|
|
43
|
+
loopHover: '#0F4C8A', // Accent text hover
|
|
39
44
|
// The stage and the quiet tint, on dark
|
|
40
|
-
loopStageDark: '#
|
|
41
|
-
loopTintDark: '#
|
|
45
|
+
loopStageDark: '#0F2333',
|
|
46
|
+
loopTintDark: '#161E25',
|
|
42
47
|
// Semantic roles — kept for verdicts and rules only
|
|
43
48
|
successBrand: '#1F8A5B',
|
|
44
49
|
successAccent: '#58C797',
|
|
@@ -72,7 +77,7 @@ export const loopColors = {
|
|
|
72
77
|
brightLightFlame: '#B4571A', // Deep orange
|
|
73
78
|
brightLightGold: '#8A6A00', // Deep sun
|
|
74
79
|
};
|
|
75
|
-
/** The six accents. One per application; everything else is neutral. */
|
|
80
|
+
/** The six accents. One per application; everything else is neutral. Sky is the theme's own. */
|
|
76
81
|
export const loopAccents = {
|
|
77
82
|
green: {
|
|
78
83
|
accent: '#7ADBB8',
|
|
@@ -173,6 +173,10 @@ export interface ThemeStyles {
|
|
|
173
173
|
* and a frame; the hairline; at most one level of shadow. As custom
|
|
174
174
|
* properties every theme sets — `--theme-radius-control` and the rest — so
|
|
175
175
|
* that a component reads its shape the way it reads its colour.
|
|
176
|
+
*
|
|
177
|
+
* And its motion (LOOP T-10): three durations — a status changing, a message
|
|
178
|
+
* arriving, a pane opening — and one easing. Today's is no motion at all, so
|
|
179
|
+
* a component that moves by them moves only in a theme that says so.
|
|
176
180
|
*/
|
|
177
181
|
export interface ThemeShape {
|
|
178
182
|
radiusControl: string;
|
|
@@ -181,6 +185,10 @@ export interface ThemeShape {
|
|
|
181
185
|
radiusFrame: string;
|
|
182
186
|
hairline: string;
|
|
183
187
|
shadow: string;
|
|
188
|
+
motionStatus: string;
|
|
189
|
+
motionMessage: string;
|
|
190
|
+
motionPane: string;
|
|
191
|
+
motionEasing: string;
|
|
184
192
|
}
|
|
185
193
|
/** Today's shape, which every theme has unless it says otherwise. */
|
|
186
194
|
export declare const DEFAULT_THEME_SHAPE: ThemeShape;
|
|
@@ -254,6 +254,10 @@ export const DEFAULT_THEME_SHAPE = {
|
|
|
254
254
|
radiusFrame: 'var(--borderRadius-large, 12px)',
|
|
255
255
|
hairline: 'var(--borderWidth-thin, 1px)',
|
|
256
256
|
shadow: 'var(--shadow-resting-small, none)',
|
|
257
|
+
motionStatus: '0ms',
|
|
258
|
+
motionMessage: '0ms',
|
|
259
|
+
motionPane: '0ms',
|
|
260
|
+
motionEasing: 'ease',
|
|
257
261
|
};
|
|
258
262
|
/** A shape as custom properties. */
|
|
259
263
|
export function shapeVars(shape = {}) {
|
|
@@ -265,6 +269,10 @@ export function shapeVars(shape = {}) {
|
|
|
265
269
|
'--theme-radius-frame': full.radiusFrame,
|
|
266
270
|
'--theme-hairline': full.hairline,
|
|
267
271
|
'--theme-shadow': full.shadow,
|
|
272
|
+
'--theme-motion-status': full.motionStatus,
|
|
273
|
+
'--theme-motion-message': full.motionMessage,
|
|
274
|
+
'--theme-motion-pane': full.motionPane,
|
|
275
|
+
'--theme-motion-easing': full.motionEasing,
|
|
268
276
|
};
|
|
269
277
|
}
|
|
270
278
|
export function buildThemeStyles(light, dark, options) {
|
|
@@ -6,6 +6,26 @@
|
|
|
6
6
|
* motion has three durations and one easing.
|
|
7
7
|
*/
|
|
8
8
|
export declare const loopShapeVars: Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Shadows, per mode: how a surface floats. Soft and low in the light —
|
|
11
|
+
* a card is told apart by its shadow more than by a line; in the dark a
|
|
12
|
+
* shadow shows little, so a surface gets a hairline of light and a
|
|
13
|
+
* deeper shadow. Primer's own shadow tokens take the same hand, so a menu
|
|
14
|
+
* or a dialog floats the way a frame does.
|
|
15
|
+
*/
|
|
16
|
+
export declare const loopShadows: Record<'light' | 'dark', Record<string, string>>;
|
|
17
|
+
/**
|
|
18
|
+
* Type: titles set tight and a little closer, as a good display face is;
|
|
19
|
+
* the body left alone. The tracking is a token for a component to apply,
|
|
20
|
+
* since a CSS font shorthand carries none.
|
|
21
|
+
*/
|
|
22
|
+
export declare const loopTypeVars: (font: string) => Record<string, string>;
|
|
23
|
+
/**
|
|
24
|
+
* The stage, lit: a soft fall from the stage tint at the top to the quiet
|
|
25
|
+
* tint at the bottom, for the page an application sits on. Both tints are
|
|
26
|
+
* the accent's, so an application's own colour lights its stage.
|
|
27
|
+
*/
|
|
28
|
+
export declare const loopStageGradient = "radial-gradient(140% 100% at 50% 0%, var(--loop-stage) 0%, var(--loop-quiet) 100%)";
|
|
9
29
|
/**
|
|
10
30
|
* The Primer theme object.
|
|
11
31
|
*
|
|
@@ -1107,11 +1127,13 @@ export declare const loopFontFamily = "Inter, ui-sans-serif, system-ui, -apple-s
|
|
|
1107
1127
|
export declare const loopMotionVars: Record<string, string>;
|
|
1108
1128
|
/**
|
|
1109
1129
|
* The focus ring (LOOP T-15): 3 to 1 against the page and around a pill of
|
|
1110
|
-
* any accent, in both modes. In light mode the
|
|
1111
|
-
*
|
|
1112
|
-
*
|
|
1113
|
-
*
|
|
1114
|
-
*
|
|
1130
|
+
* any accent, in both modes. In light mode the deep accent blue does it —
|
|
1131
|
+
* a halo in the theme's colour, as a system's own focus ring is — 6.5 to 1
|
|
1132
|
+
* on white and 3.3 or more around every pastel. In dark mode no
|
|
1133
|
+
* colour clears 3 to 1 against both the near-black page and the six
|
|
1134
|
+
* pastels, the light ink least of all (under 1.8 to 1 on the pastels): a
|
|
1135
|
+
* mid grey does, at 3.04 to 1 — and 2.77 to 1 on the subtle dark surface,
|
|
1136
|
+
* the one place it falls short.
|
|
1115
1137
|
*/
|
|
1116
1138
|
export declare const loopFocusRing: {
|
|
1117
1139
|
readonly light: string;
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Loop Theme for Primer React.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Soft and clear, for somebody who is not here for the software: one accent,
|
|
9
|
+
* neutral everything else. A white (or near-black) canvas, a deep-grey ink
|
|
10
|
+
* rather than black, faint hairlines, surfaces that float on soft shadows
|
|
11
|
+
* instead of sitting in boxes, generous rounding, and one filled button in
|
|
12
|
+
* the accent — the thing to press, plain to see. Inter, with the system
|
|
13
|
+
* sans-serif stack behind it, titles set tight.
|
|
12
14
|
* Theming is applied via **CSS custom-property overrides**.
|
|
13
15
|
*
|
|
14
16
|
* Unlike the other themes it also sets **shape**: rounder corners, and
|
|
@@ -31,7 +33,7 @@ const loopLight = {
|
|
|
31
33
|
},
|
|
32
34
|
accent: {
|
|
33
35
|
fg: loopColors.loopText,
|
|
34
|
-
emphasis: loopColors.
|
|
36
|
+
emphasis: loopColors.loopEmphasis,
|
|
35
37
|
muted: loopColors.loopBrand,
|
|
36
38
|
subtle: loopColors.loopTint,
|
|
37
39
|
},
|
|
@@ -66,31 +68,32 @@ const loopLight = {
|
|
|
66
68
|
subtle: loopColors.doneTint,
|
|
67
69
|
},
|
|
68
70
|
border: {
|
|
69
|
-
// Hairlines:
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
// Hairlines: 7% of the ink, as solid colours on white — a surface is
|
|
72
|
+
// told apart by its shadow more than by a line.
|
|
73
|
+
default: '#ECECEE',
|
|
74
|
+
muted: '#F2F2F4',
|
|
72
75
|
},
|
|
73
76
|
btn: {
|
|
74
77
|
text: loopColors.ink,
|
|
75
78
|
bg: loopColors.subtle,
|
|
76
79
|
border: 'transparent',
|
|
77
|
-
hoverBg: '#
|
|
80
|
+
hoverBg: '#ECECEF',
|
|
78
81
|
hoverBorder: 'transparent',
|
|
79
|
-
activeBg: '#
|
|
82
|
+
activeBg: '#E3E3E7',
|
|
80
83
|
activeBorder: 'transparent',
|
|
81
|
-
selectedBg: '#
|
|
82
|
-
counterBg: 'rgba(
|
|
83
|
-
// The one filled button of a screen
|
|
84
|
+
selectedBg: '#E3E3E7',
|
|
85
|
+
counterBg: 'rgba(29, 29, 31, 0.08)',
|
|
86
|
+
// The one filled button of a screen, in the accent: the thing to press.
|
|
84
87
|
primary: {
|
|
85
88
|
text: '#FFFFFF',
|
|
86
|
-
bg: loopColors.
|
|
87
|
-
border: loopColors.
|
|
88
|
-
hoverBg:
|
|
89
|
-
hoverBorder:
|
|
90
|
-
selectedBg:
|
|
91
|
-
disabledText: 'rgba(255, 255, 255, 0.
|
|
92
|
-
disabledBg: '#
|
|
93
|
-
disabledBorder: '#
|
|
89
|
+
bg: loopColors.loopEmphasis,
|
|
90
|
+
border: loopColors.loopEmphasis,
|
|
91
|
+
hoverBg: loopColors.loopEmphasisHover,
|
|
92
|
+
hoverBorder: loopColors.loopEmphasisHover,
|
|
93
|
+
selectedBg: loopColors.loopText,
|
|
94
|
+
disabledText: 'rgba(255, 255, 255, 0.85)',
|
|
95
|
+
disabledBg: '#A9D8C6',
|
|
96
|
+
disabledBorder: '#A9D8C6',
|
|
94
97
|
icon: '#FFFFFF',
|
|
95
98
|
counterBg: 'rgba(255, 255, 255, 0.2)',
|
|
96
99
|
},
|
|
@@ -144,7 +147,8 @@ const loopDark = {
|
|
|
144
147
|
},
|
|
145
148
|
accent: {
|
|
146
149
|
fg: loopColors.loopBright,
|
|
147
|
-
|
|
150
|
+
// The accent itself, on dark: a pastel that dark text sits on.
|
|
151
|
+
emphasis: loopColors.loopBrand,
|
|
148
152
|
muted: loopColors.loopBrand,
|
|
149
153
|
subtle: loopColors.loopTintDark,
|
|
150
154
|
},
|
|
@@ -179,9 +183,9 @@ const loopDark = {
|
|
|
179
183
|
subtle: '#1C1A27',
|
|
180
184
|
},
|
|
181
185
|
border: {
|
|
182
|
-
// Hairlines:
|
|
183
|
-
default: '#
|
|
184
|
-
muted: '#
|
|
186
|
+
// Hairlines: 10% of the ink, as solid colours on near-black.
|
|
187
|
+
default: '#2A2A2C',
|
|
188
|
+
muted: '#222224',
|
|
185
189
|
},
|
|
186
190
|
btn: {
|
|
187
191
|
text: loopColors.inkDark,
|
|
@@ -192,20 +196,21 @@ const loopDark = {
|
|
|
192
196
|
activeBg: '#303033',
|
|
193
197
|
activeBorder: 'transparent',
|
|
194
198
|
selectedBg: '#303033',
|
|
195
|
-
counterBg: 'rgba(
|
|
196
|
-
// The one filled button of a screen:
|
|
199
|
+
counterBg: 'rgba(245, 245, 247, 0.12)',
|
|
200
|
+
// The one filled button of a screen, in the accent: the pastel, with
|
|
201
|
+
// its dark text, the brightest thing on a dark page.
|
|
197
202
|
primary: {
|
|
198
|
-
text: loopColors.
|
|
199
|
-
bg: loopColors.
|
|
200
|
-
border: loopColors.
|
|
201
|
-
hoverBg:
|
|
202
|
-
hoverBorder:
|
|
203
|
-
selectedBg: '#
|
|
204
|
-
disabledText: 'rgba(
|
|
205
|
-
disabledBg: 'rgba(
|
|
206
|
-
disabledBorder: '
|
|
207
|
-
icon: loopColors.
|
|
208
|
-
counterBg: 'rgba(
|
|
203
|
+
text: loopColors.loopOn,
|
|
204
|
+
bg: loopColors.loopBrand,
|
|
205
|
+
border: loopColors.loopBrand,
|
|
206
|
+
hoverBg: loopColors.loopBright,
|
|
207
|
+
hoverBorder: loopColors.loopBright,
|
|
208
|
+
selectedBg: '#6CCFAA',
|
|
209
|
+
disabledText: 'rgba(6, 40, 30, 0.6)',
|
|
210
|
+
disabledBg: 'rgba(122, 219, 184, 0.35)',
|
|
211
|
+
disabledBorder: 'transparent',
|
|
212
|
+
icon: loopColors.loopOn,
|
|
213
|
+
counterBg: 'rgba(6, 40, 30, 0.15)',
|
|
209
214
|
},
|
|
210
215
|
outline: {
|
|
211
216
|
text: loopColors.loopBright,
|
|
@@ -253,15 +258,16 @@ const loopDark = {
|
|
|
253
258
|
* motion has three durations and one easing.
|
|
254
259
|
*/
|
|
255
260
|
export const loopShapeVars = {
|
|
256
|
-
'--borderRadius-small': '
|
|
257
|
-
'--borderRadius-medium': '
|
|
258
|
-
'--borderRadius-large': '
|
|
259
|
-
'--borderRadius-default': '
|
|
261
|
+
'--borderRadius-small': '10px',
|
|
262
|
+
'--borderRadius-medium': '14px',
|
|
263
|
+
'--borderRadius-large': '20px',
|
|
264
|
+
'--borderRadius-default': '14px',
|
|
260
265
|
'--loop-radius-control': '999px',
|
|
261
|
-
'--loop-radius-card': '
|
|
262
|
-
'--loop-radius-bubble': '
|
|
263
|
-
'--loop-radius-frame': '
|
|
264
|
-
|
|
266
|
+
'--loop-radius-card': '20px',
|
|
267
|
+
'--loop-radius-bubble': '22px',
|
|
268
|
+
'--loop-radius-frame': '28px',
|
|
269
|
+
// Light mode's; `loopShadows` says dark mode's.
|
|
270
|
+
'--loop-shadow-frame': '0 1px 2px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.06)',
|
|
265
271
|
'--loop-face-large': '72px',
|
|
266
272
|
'--loop-face-medium': '40px',
|
|
267
273
|
'--loop-face-small': '20px',
|
|
@@ -272,9 +278,61 @@ export const loopShapeVars = {
|
|
|
272
278
|
};
|
|
273
279
|
/** The hairline between two surfaces, per mode. */
|
|
274
280
|
const loopHairline = {
|
|
275
|
-
light: 'rgba(
|
|
276
|
-
dark: 'rgba(255, 255, 255, 0.
|
|
281
|
+
light: 'rgba(29, 29, 31, 0.07)',
|
|
282
|
+
dark: 'rgba(255, 255, 255, 0.10)',
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Shadows, per mode: how a surface floats. Soft and low in the light —
|
|
286
|
+
* a card is told apart by its shadow more than by a line; in the dark a
|
|
287
|
+
* shadow shows little, so a surface gets a hairline of light and a
|
|
288
|
+
* deeper shadow. Primer's own shadow tokens take the same hand, so a menu
|
|
289
|
+
* or a dialog floats the way a frame does.
|
|
290
|
+
*/
|
|
291
|
+
export const loopShadows = {
|
|
292
|
+
light: {
|
|
293
|
+
'--loop-shadow-frame': '0 1px 2px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.06)',
|
|
294
|
+
'--theme-shadow': '0 1px 2px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.06)',
|
|
295
|
+
'--shadow-resting-xsmall': '0 1px 1px rgba(0, 0, 0, 0.03)',
|
|
296
|
+
'--shadow-resting-small': '0 1px 2px rgba(0, 0, 0, 0.04)',
|
|
297
|
+
'--shadow-resting-medium': '0 2px 8px rgba(0, 0, 0, 0.05)',
|
|
298
|
+
'--shadow-floating-small': '0 0 0 1px rgba(29, 29, 31, 0.04), 0 4px 14px rgba(0, 0, 0, 0.08)',
|
|
299
|
+
'--shadow-floating-medium': '0 0 0 1px rgba(29, 29, 31, 0.04), 0 8px 24px rgba(0, 0, 0, 0.10)',
|
|
300
|
+
'--shadow-floating-large': '0 0 0 1px rgba(29, 29, 31, 0.04), 0 16px 48px rgba(0, 0, 0, 0.14)',
|
|
301
|
+
'--shadow-floating-xlarge': '0 0 0 1px rgba(29, 29, 31, 0.04), 0 24px 64px rgba(0, 0, 0, 0.18)',
|
|
302
|
+
},
|
|
303
|
+
dark: {
|
|
304
|
+
'--loop-shadow-frame': '0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 36px rgba(0, 0, 0, 0.45)',
|
|
305
|
+
'--theme-shadow': '0 0 0 1px rgba(255, 255, 255, 0.06), 0 12px 36px rgba(0, 0, 0, 0.45)',
|
|
306
|
+
'--shadow-resting-xsmall': '0 0 0 1px rgba(255, 255, 255, 0.05)',
|
|
307
|
+
'--shadow-resting-small': '0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.3)',
|
|
308
|
+
'--shadow-resting-medium': '0 0 0 1px rgba(255, 255, 255, 0.06), 0 2px 8px rgba(0, 0, 0, 0.35)',
|
|
309
|
+
'--shadow-floating-small': '0 0 0 1px rgba(255, 255, 255, 0.08), 0 4px 14px rgba(0, 0, 0, 0.45)',
|
|
310
|
+
'--shadow-floating-medium': '0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.5)',
|
|
311
|
+
'--shadow-floating-large': '0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 48px rgba(0, 0, 0, 0.55)',
|
|
312
|
+
'--shadow-floating-xlarge': '0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 64px rgba(0, 0, 0, 0.6)',
|
|
313
|
+
},
|
|
277
314
|
};
|
|
315
|
+
/**
|
|
316
|
+
* Type: titles set tight and a little closer, as a good display face is;
|
|
317
|
+
* the body left alone. The tracking is a token for a component to apply,
|
|
318
|
+
* since a CSS font shorthand carries none.
|
|
319
|
+
*/
|
|
320
|
+
export const loopTypeVars = (font) => ({
|
|
321
|
+
'--text-display-shorthand': `600 2.75rem/1.15 ${font}`,
|
|
322
|
+
'--text-title-shorthand-large': `600 2rem/1.25 ${font}`,
|
|
323
|
+
'--text-title-shorthand-medium': `600 1.25rem/1.35 ${font}`,
|
|
324
|
+
'--text-title-shorthand-small': `600 1rem/1.4 ${font}`,
|
|
325
|
+
'--text-subtitle-shorthand': `400 1.25rem/1.5 ${font}`,
|
|
326
|
+
'--loop-tracking-display': '-0.02em',
|
|
327
|
+
'--loop-tracking-title': '-0.012em',
|
|
328
|
+
'--loop-tracking-body': '0',
|
|
329
|
+
});
|
|
330
|
+
/**
|
|
331
|
+
* The stage, lit: a soft fall from the stage tint at the top to the quiet
|
|
332
|
+
* tint at the bottom, for the page an application sits on. Both tints are
|
|
333
|
+
* the accent's, so an application's own colour lights its stage.
|
|
334
|
+
*/
|
|
335
|
+
export const loopStageGradient = 'radial-gradient(140% 100% at 50% 0%, var(--loop-stage) 0%, var(--loop-quiet) 100%)';
|
|
278
336
|
/* ── Exports ─────────────────────────────────────────────────────────── */
|
|
279
337
|
/**
|
|
280
338
|
* The Primer theme object.
|
|
@@ -302,13 +360,15 @@ export const loopMotionVars = {
|
|
|
302
360
|
};
|
|
303
361
|
/**
|
|
304
362
|
* The focus ring (LOOP T-15): 3 to 1 against the page and around a pill of
|
|
305
|
-
* any accent, in both modes. In light mode the
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
363
|
+
* any accent, in both modes. In light mode the deep accent blue does it —
|
|
364
|
+
* a halo in the theme's colour, as a system's own focus ring is — 6.5 to 1
|
|
365
|
+
* on white and 3.3 or more around every pastel. In dark mode no
|
|
366
|
+
* colour clears 3 to 1 against both the near-black page and the six
|
|
367
|
+
* pastels, the light ink least of all (under 1.8 to 1 on the pastels): a
|
|
368
|
+
* mid grey does, at 3.04 to 1 — and 2.77 to 1 on the subtle dark surface,
|
|
369
|
+
* the one place it falls short.
|
|
310
370
|
*/
|
|
311
|
-
export const loopFocusRing = { light: loopColors.
|
|
371
|
+
export const loopFocusRing = { light: loopColors.loopText, dark: '#636363' };
|
|
312
372
|
/** Comprehensive Primer CSS-variable overrides for light & dark mode. */
|
|
313
373
|
export const loopThemeStyles = buildThemeStyles(loopLight, loopDark, {
|
|
314
374
|
fontFamily: loopFontFamily,
|
|
@@ -319,19 +379,29 @@ export const loopThemeStyles = buildThemeStyles(loopLight, loopDark, {
|
|
|
319
379
|
radiusBubble: loopShapeVars['--loop-radius-bubble'],
|
|
320
380
|
radiusFrame: loopShapeVars['--loop-radius-frame'],
|
|
321
381
|
shadow: loopShapeVars['--loop-shadow-frame'],
|
|
382
|
+
motionStatus: loopMotionVars['--loop-motion-status'],
|
|
383
|
+
motionMessage: loopMotionVars['--loop-motion-message'],
|
|
384
|
+
motionPane: loopMotionVars['--loop-motion-pane'],
|
|
385
|
+
motionEasing: loopMotionVars['--loop-motion-easing'],
|
|
322
386
|
},
|
|
323
387
|
variables: {
|
|
324
388
|
light: {
|
|
325
389
|
...loopShapeVars,
|
|
326
|
-
...loopAccentVars('
|
|
390
|
+
...loopAccentVars('sky', 'light'),
|
|
327
391
|
...loopMotionVars,
|
|
392
|
+
...loopShadows.light,
|
|
393
|
+
...loopTypeVars(loopFontFamily),
|
|
394
|
+
'--loop-stage-gradient': loopStageGradient,
|
|
328
395
|
'--loop-hairline': loopHairline.light,
|
|
329
396
|
'--focus-outlineColor': loopFocusRing.light,
|
|
330
397
|
},
|
|
331
398
|
dark: {
|
|
332
399
|
...loopShapeVars,
|
|
333
|
-
...loopAccentVars('
|
|
400
|
+
...loopAccentVars('sky', 'dark'),
|
|
334
401
|
...loopMotionVars,
|
|
402
|
+
...loopShadows.dark,
|
|
403
|
+
...loopTypeVars(loopFontFamily),
|
|
404
|
+
'--loop-stage-gradient': loopStageGradient,
|
|
335
405
|
'--loop-hairline': loopHairline.dark,
|
|
336
406
|
'--focus-outlineColor': loopFocusRing.dark,
|
|
337
407
|
},
|