@vettvangur/design-system 2.0.37 → 2.0.38

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 +34 -31
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3523,15 +3523,15 @@ async function generateShadows(variableSet, config) {
3523
3523
  message(`finished generating shadows (${lines.length})`);
3524
3524
  }
3525
3525
 
3526
- /**
3527
- * design-system :: src/generators/tailwind/screens.mjs.
3528
- *
3529
- * Design token tooling: pulls from Figma and generates platform outputs (Razor/Astro/Tailwind).
3530
- *
3531
- * These docs are generated from inline JSDoc in the repo and are intended for contributors.
3532
- *
3533
- * @generated
3534
- * @module design-system
3526
+ /**
3527
+ * design-system :: src/generators/tailwind/screens.mjs.
3528
+ *
3529
+ * Design token tooling: pulls from Figma and generates platform outputs (Razor/Astro/Tailwind).
3530
+ *
3531
+ * These docs are generated from inline JSDoc in the repo and are intended for contributors.
3532
+ *
3533
+ * @generated
3534
+ * @module design-system
3535
3535
  */
3536
3536
  const BASE_SCREENS = {
3537
3537
  'phone-xs': 0,
@@ -3565,33 +3565,36 @@ function buildScreensCss(extra = {}) {
3565
3565
  const keys = Object.keys(merged).sort((a, b) => a.localeCompare(b, 'en'));
3566
3566
  const lines = ['/* AUTO-GENERATED - DO NOT EDIT BY HAND */', '', '@theme {'];
3567
3567
  for (const key of keys) {
3568
- lines.push(` --breakpoint-${key}: ${merged[key]};`);
3568
+ // Base breakpoints are pixel values and should be remified.
3569
+ // Figma-provided Screens values are already authored as unit-less values.
3570
+ const v = Object.hasOwn(BASE_SCREENS, key) ? rem(merged[key]) : String(merged[key]);
3571
+ lines.push(` --breakpoint-${key}: ${v};`);
3569
3572
  }
3570
3573
  lines.push('}', '');
3571
3574
  return `${lines.join('\n')}\n`;
3572
3575
  }
3573
3576
 
3574
- /**
3575
- * Generate screens.
3576
- *
3577
- * Writes `screens.css` containing the built-in breakpoints plus any additional
3578
- * breakpoint values found in the Figma variable collection named `Screens`.
3579
- *
3580
- * The Figma variable collection is expected to be present under
3581
- * `figmaVariables.screens.tokens` (collection keys are kebab-cased).
3582
- *
3583
- * Existing built-in breakpoints are never removed. If Figma provides a token
3584
- * with the same key as a built-in breakpoint, the built-in value wins.
3585
- *
3586
- * @param figmaVariables - Raw Figma variables map (from `src/figma/index.mjs`).
3587
- * @param config - Configuration object.
3588
- * @returns Nothing.
3589
- *
3590
- * @example
3591
- * // design-system (src/tools/javascript/design-system/src/generators/tailwind/screens.mjs)
3592
- * // import { generateScreens } from '@vettvangur/design-system'
3593
- *
3594
- * await generateScreens({ screens: { tokens: { kiosk: { values: { Default: 1920 } } } } }, { paths: { styles: './src/styles' } })
3577
+ /**
3578
+ * Generate screens.
3579
+ *
3580
+ * Writes `screens.css` containing the built-in breakpoints plus any additional
3581
+ * breakpoint values found in the Figma variable collection named `Screens`.
3582
+ *
3583
+ * The Figma variable collection is expected to be present under
3584
+ * `figmaVariables.screens.tokens` (collection keys are kebab-cased).
3585
+ *
3586
+ * Existing built-in breakpoints are never removed. If Figma provides a token
3587
+ * with the same key as a built-in breakpoint, the built-in value wins.
3588
+ *
3589
+ * @param figmaVariables - Raw Figma variables map (from `src/figma/index.mjs`).
3590
+ * @param config - Configuration object.
3591
+ * @returns Nothing.
3592
+ *
3593
+ * @example
3594
+ * // design-system (src/tools/javascript/design-system/src/generators/tailwind/screens.mjs)
3595
+ * // import { generateScreens } from '@vettvangur/design-system'
3596
+ *
3597
+ * await generateScreens({ screens: { tokens: { kiosk: { values: { Default: 1920 } } } } }, { paths: { styles: './src/styles' } })
3595
3598
  */
3596
3599
  async function generateScreens(figmaVariables, config) {
3597
3600
  message('generating breakpoints...');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vettvangur/design-system",
3
- "version": "2.0.37",
3
+ "version": "2.0.38",
4
4
  "description": "",
5
5
  "access": "public",
6
6
  "type": "module",