rafters 0.0.30 → 0.0.31

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 +8 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -57654,11 +57654,13 @@ function generateRadiusTokens(config3, radiusDefs) {
57654
57654
  } else if (def.step === "full") {
57655
57655
  value2 = "9999px";
57656
57656
  mathRelationship = "infinite (9999px)";
57657
+ } else if (def.step === 0) {
57658
+ value2 = "var(--rafters-radius-base)";
57659
+ mathRelationship = `${baseRadiusRem}rem (base)`;
57657
57660
  } else {
57658
- const computedPx = Math.round(progression.compute(baseRadius, def.step) * 100) / 100;
57659
- const computedRem = Math.round(computedPx / 16 * 100) / 100;
57660
- value2 = `${computedRem}rem`;
57661
- mathRelationship = def.step === 0 ? `${baseRadiusRem}rem (base)` : `${baseRadiusRem} \xD7 ${progression.ratio}^${def.step}`;
57661
+ const multiplier = Math.round(progression.ratio ** def.step * 1e3) / 1e3;
57662
+ value2 = `calc(var(--rafters-radius-base) * ${multiplier})`;
57663
+ mathRelationship = `base \xD7 ${progression.ratio}^${def.step} (\xD7${multiplier})`;
57662
57664
  }
57663
57665
  tokens.push({
57664
57666
  name: scale3 === "DEFAULT" ? "radius" : `radius-${scale3}`,
@@ -57910,9 +57912,10 @@ function generateSpacingTokens(config3, spacingMultipliers) {
57910
57912
  usageContext = ["hero-spacing", "page-margins", "major-sections"];
57911
57913
  }
57912
57914
  const remValue = value2 / 16;
57915
+ const cssValue = multiplier === 0 ? "0" : multiplier === 1 ? "var(--rafters-spacing-base)" : `calc(var(--rafters-spacing-base) * ${multiplier})`;
57913
57916
  tokens.push({
57914
57917
  name: `spacing-${scale3}`,
57915
- value: value2 === 0 ? "0" : `${remValue}rem`,
57918
+ value: cssValue,
57916
57919
  category: "spacing",
57917
57920
  namespace: "spacing",
57918
57921
  semanticMeaning: meaning,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rafters",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "CLI for Rafters design system - scaffold tokens and add components",
5
5
  "license": "MIT",
6
6
  "type": "module",