@vettvangur/design-system 2.0.70 → 2.0.72

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2663,7 +2663,9 @@ const renderApplyLine = (prefix, token, indent = ' ') => {
2663
2663
  return '';
2664
2664
  }
2665
2665
  if (prefix === 'text') {
2666
- return token.startsWith('text-') ? `${indent}@apply ${token};\n` : `${indent}@apply text-${token};\n`;
2666
+ // Tailwind text color utilities are always `text-{token}`.
2667
+ // If the token itself starts with `text-` (e.g. `text-grey`), we still prefix it: `text-text-grey`.
2668
+ return `${indent}@apply text-${token};\n`;
2667
2669
  }
2668
2670
  return `${indent}@apply ${prefix}-${token};\n`;
2669
2671
  };
@@ -3511,8 +3513,7 @@ async function renderTypography(tokens, config) {
3511
3513
  return;
3512
3514
  }
3513
3515
  if (typeof value === 'number') {
3514
- const k = String(key);
3515
- const v = value === 0 ? '0' : k.startsWith('text-') || k.startsWith('leading-') ? rem(value) : `${value}px`;
3516
+ const v = value === 0 ? '0' : rem(value);
3516
3517
  return ` --${key}: ${v};\n`;
3517
3518
  }
3518
3519
  return ` --${key}: ${String(value)};\n`; // already has units
@@ -3713,14 +3714,14 @@ function ensureVar(lines, varName, value) {
3713
3714
  *
3714
3715
  * addRem(map, name, n)
3715
3716
  */
3716
- function addPx(map, name, n) {
3717
+ function addRem(map, name, n) {
3717
3718
  if (n == null) {
3718
3719
  return;
3719
3720
  }
3720
3721
  if (map.has(name)) {
3721
3722
  return;
3722
3723
  }
3723
- map.set(name, n === 0 ? '0' : `${n}px`);
3724
+ map.set(name, n === 0 ? '0' : rem(n));
3724
3725
  }
3725
3726
 
3726
3727
  /**
@@ -3744,7 +3745,7 @@ function generateSpacingCss(scales) {
3744
3745
  if (v == null) {
3745
3746
  continue;
3746
3747
  }
3747
- addPx(map, `--spacing-${kebab$1(tokenKey)}`, v);
3748
+ addRem(map, `--spacing-${kebab$1(tokenKey)}`, v);
3748
3749
  }
3749
3750
  };
3750
3751
 
@@ -3760,7 +3761,7 @@ function generateSpacingCss(scales) {
3760
3761
  continue;
3761
3762
  }
3762
3763
  const k = kebab$1(tokenKey).replace(/^scale-/, '');
3763
- addPx(map, `--spacing-vertical-${k}`, v);
3764
+ addRem(map, `--spacing-vertical-${k}`, v);
3764
3765
  }
3765
3766
  const lines = Array.from(map.entries()).map(([k, v]) => ` ${k}: ${v};`);
3766
3767
 
@@ -3794,7 +3795,7 @@ function generateBorderCss(scales) {
3794
3795
  if (v == null) {
3795
3796
  continue;
3796
3797
  }
3797
- addPx(map, `--border-${kebab$1(tokenKey)}`, v);
3798
+ addRem(map, `--border-${kebab$1(tokenKey)}`, v);
3798
3799
  }
3799
3800
  const lines = Array.from(map.entries()).map(([k, v]) => ` ${k}: ${v};`);
3800
3801
 
@@ -3852,7 +3853,7 @@ function generateRadiusCss(scales) {
3852
3853
  }
3853
3854
  continue;
3854
3855
  }
3855
- addPx(map, `--radius-${k}`, v);
3856
+ addRem(map, `--radius-${k}`, v);
3856
3857
  }
3857
3858
  if (debug) {
3858
3859
  console.log('[design-system] radius: emitted =', map.size, '| skipped(manual)=', skippedManual, '| skipped(null)=', skippedNull);
@@ -3865,7 +3866,7 @@ function generateRadiusCss(scales) {
3865
3866
  // manual required defaults
3866
3867
  ensureVar(lines, '--radius-0', '0');
3867
3868
  ensureVar(lines, '--radius-circle', '50%');
3868
- ensureVar(lines, '--radius-rounded', '100px');
3869
+ ensureVar(lines, '--radius-rounded', rem(100));
3869
3870
  return `/* AUTO-GENERATED - DO NOT EDIT BY HAND */\n\n${renderTheme$1(lines)}`;
3870
3871
  }
3871
3872
 
@@ -4016,7 +4017,7 @@ function effectToBoxShadow(effect) {
4016
4017
  const color = rgbaFromColor(effect.color) ?? 'rgba(0 0 0 / 0.25)';
4017
4018
 
4018
4019
  // "x y blur spread color"
4019
- const len = n => n === 0 ? '0' : `${n}px`;
4020
+ const len = n => n === 0 ? '0' : rem(n);
4020
4021
  return `${len(x)} ${len(y)} ${len(blur)} ${len(spread)} ${color}`;
4021
4022
  }
4022
4023
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vettvangur/design-system",
3
- "version": "2.0.70",
3
+ "version": "2.0.72",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "type": "module",