@motion-proto/live-tokens 0.53.0 → 0.54.1
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/.claude/skills/live-tokens-adjust-shape-space/SKILL.md +21 -2
- package/.claude/skills/live-tokens-generate-theme/SKILL.md +16 -1
- package/CHANGELOG.md +47 -0
- package/bin/generate-theme.mjs +1 -0
- package/dist-plugin/adjust/index.cjs +10 -6
- package/dist-plugin/adjust/index.js +10 -6
- package/dist-plugin/generateColorsAndType/index.cjs +63 -0
- package/dist-plugin/generateColorsAndType/index.d.cts +4 -1
- package/dist-plugin/generateColorsAndType/index.d.ts +4 -1
- package/dist-plugin/generateColorsAndType/index.js +63 -0
- package/package.json +1 -1
- package/src/editor/core/components/adjustAliases.ts +23 -7
- package/src/editor/core/themes/generateColorsAndType.ts +50 -1
- package/src/editor/core/themes/parsers/shadow.ts +52 -0
- package/src/editor/core/themes/slices/shadows.ts +2 -38
- package/src/editor/ui/PaletteEditor.svelte +2 -2
- package/src/live-tokens/data/colors-and-type/autumn.json +5 -5
- package/src/live-tokens/data/colors-and-type/ocean.json +5 -5
- package/src/live-tokens/data/colors-and-type/spring-meadow.json +5 -5
- package/src/live-tokens/data/themes/autumn.json +5 -5
- package/src/live-tokens/data/themes/midnight-study.json +39 -39
- package/src/live-tokens/data/themes/ocean.json +5 -5
- package/src/live-tokens/data/themes/spring-meadow.json +5 -5
- package/src/system/components/FloatingTokenTags.css +16 -11
- package/src/system/components/FloatingTokenTags.svelte +3 -0
- package/src/system/internal/backgroundContrast.ts +2 -1
|
@@ -200,6 +200,9 @@
|
|
|
200
200
|
lastPageBackground = pageBackground;
|
|
201
201
|
const token = contrastTokenForBackground(pageBackground);
|
|
202
202
|
stageEl.style.setProperty('--ftt-contrast-color', `var(${token})`);
|
|
203
|
+
// Dark strokes on a light page read far heavier than white ones on a dark
|
|
204
|
+
// page at the same alpha, so the light theme gets a thinner string.
|
|
205
|
+
stageEl.style.setProperty('--ftt-string-opacity', token === '--color-black' ? '0.3' : '0.5');
|
|
203
206
|
}
|
|
204
207
|
|
|
205
208
|
function syncBoxLabelContrast() {
|
|
@@ -48,7 +48,8 @@ function luminance({ r, g, b }: Rgb): number {
|
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Pick the invariant black/white token with the stronger minimum contrast
|
|
51
|
-
* against every explicit colour in a solid or gradient page background
|
|
51
|
+
* against every explicit colour in a solid or gradient page background —
|
|
52
|
+
* the rule FloatingTokenTags uses for its kite strings.
|
|
52
53
|
*/
|
|
53
54
|
export function contrastTokenForBackground(background: string): ContrastColorToken {
|
|
54
55
|
const colors = colorsIn(background);
|