@vettvangur/design-system 2.0.69 → 2.0.70
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/index.js +10 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3511,7 +3511,8 @@ async function renderTypography(tokens, config) {
|
|
|
3511
3511
|
return;
|
|
3512
3512
|
}
|
|
3513
3513
|
if (typeof value === 'number') {
|
|
3514
|
-
const
|
|
3514
|
+
const k = String(key);
|
|
3515
|
+
const v = value === 0 ? '0' : k.startsWith('text-') || k.startsWith('leading-') ? rem(value) : `${value}px`;
|
|
3515
3516
|
return ` --${key}: ${v};\n`;
|
|
3516
3517
|
}
|
|
3517
3518
|
return ` --${key}: ${String(value)};\n`; // already has units
|
|
@@ -3712,14 +3713,14 @@ function ensureVar(lines, varName, value) {
|
|
|
3712
3713
|
*
|
|
3713
3714
|
* addRem(map, name, n)
|
|
3714
3715
|
*/
|
|
3715
|
-
function
|
|
3716
|
+
function addPx(map, name, n) {
|
|
3716
3717
|
if (n == null) {
|
|
3717
3718
|
return;
|
|
3718
3719
|
}
|
|
3719
3720
|
if (map.has(name)) {
|
|
3720
3721
|
return;
|
|
3721
3722
|
}
|
|
3722
|
-
map.set(name, n === 0 ? '0' :
|
|
3723
|
+
map.set(name, n === 0 ? '0' : `${n}px`);
|
|
3723
3724
|
}
|
|
3724
3725
|
|
|
3725
3726
|
/**
|
|
@@ -3743,7 +3744,7 @@ function generateSpacingCss(scales) {
|
|
|
3743
3744
|
if (v == null) {
|
|
3744
3745
|
continue;
|
|
3745
3746
|
}
|
|
3746
|
-
|
|
3747
|
+
addPx(map, `--spacing-${kebab$1(tokenKey)}`, v);
|
|
3747
3748
|
}
|
|
3748
3749
|
};
|
|
3749
3750
|
|
|
@@ -3759,7 +3760,7 @@ function generateSpacingCss(scales) {
|
|
|
3759
3760
|
continue;
|
|
3760
3761
|
}
|
|
3761
3762
|
const k = kebab$1(tokenKey).replace(/^scale-/, '');
|
|
3762
|
-
|
|
3763
|
+
addPx(map, `--spacing-vertical-${k}`, v);
|
|
3763
3764
|
}
|
|
3764
3765
|
const lines = Array.from(map.entries()).map(([k, v]) => ` ${k}: ${v};`);
|
|
3765
3766
|
|
|
@@ -3793,7 +3794,7 @@ function generateBorderCss(scales) {
|
|
|
3793
3794
|
if (v == null) {
|
|
3794
3795
|
continue;
|
|
3795
3796
|
}
|
|
3796
|
-
|
|
3797
|
+
addPx(map, `--border-${kebab$1(tokenKey)}`, v);
|
|
3797
3798
|
}
|
|
3798
3799
|
const lines = Array.from(map.entries()).map(([k, v]) => ` ${k}: ${v};`);
|
|
3799
3800
|
|
|
@@ -3851,7 +3852,7 @@ function generateRadiusCss(scales) {
|
|
|
3851
3852
|
}
|
|
3852
3853
|
continue;
|
|
3853
3854
|
}
|
|
3854
|
-
|
|
3855
|
+
addPx(map, `--radius-${k}`, v);
|
|
3855
3856
|
}
|
|
3856
3857
|
if (debug) {
|
|
3857
3858
|
console.log('[design-system] radius: emitted =', map.size, '| skipped(manual)=', skippedManual, '| skipped(null)=', skippedNull);
|
|
@@ -3864,7 +3865,7 @@ function generateRadiusCss(scales) {
|
|
|
3864
3865
|
// manual required defaults
|
|
3865
3866
|
ensureVar(lines, '--radius-0', '0');
|
|
3866
3867
|
ensureVar(lines, '--radius-circle', '50%');
|
|
3867
|
-
ensureVar(lines, '--radius-rounded',
|
|
3868
|
+
ensureVar(lines, '--radius-rounded', '100px');
|
|
3868
3869
|
return `/* AUTO-GENERATED - DO NOT EDIT BY HAND */\n\n${renderTheme$1(lines)}`;
|
|
3869
3870
|
}
|
|
3870
3871
|
|
|
@@ -4015,7 +4016,7 @@ function effectToBoxShadow(effect) {
|
|
|
4015
4016
|
const color = rgbaFromColor(effect.color) ?? 'rgba(0 0 0 / 0.25)';
|
|
4016
4017
|
|
|
4017
4018
|
// "x y blur spread color"
|
|
4018
|
-
const len = n => n === 0 ? '0' :
|
|
4019
|
+
const len = n => n === 0 ? '0' : `${n}px`;
|
|
4019
4020
|
return `${len(x)} ${len(y)} ${len(blur)} ${len(spread)} ${color}`;
|
|
4020
4021
|
}
|
|
4021
4022
|
|