@homebound/truss 2.29.2 → 2.29.4

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/build/index.js CHANGED
@@ -69,7 +69,7 @@ function newAliasesMethods(aliases) {
69
69
  }
70
70
  function newSetCssVariablesMethod(abbr, defs) {
71
71
  collect({ kind: "cssvar", abbr, defs: { ...defs } });
72
- return `get ${abbr}() { return this${Object.entries(defs).map(([prop, value]) => `.add("${prop}" as any, "${value}")`).join("")}; }`;
72
+ return `get ${abbr}() { return this${Object.entries(defs).map(([prop, value]) => `.add("${prop}" as any, ${JSON.stringify(value)})`).join("")}; }`;
73
73
  }
74
74
  function newIncrementMethods(config, abbr, prop, opts = {}) {
75
75
  const props = typeof prop === "string" ? [prop] : prop;
@@ -115,7 +115,7 @@ function newPxMethods(abbr, props) {
115
115
  }
116
116
  var zeroTo = (n) => [...Array(n + 1).keys()];
117
117
  function maybeWrap(value) {
118
- return typeof value === "number" ? String(value) : `"${value}"`;
118
+ return typeof value === "number" ? String(value) : JSON.stringify(String(value));
119
119
  }
120
120
  function comment(defs) {
121
121
  const paramNames = ["value", "px", "inc"];
@@ -584,7 +584,7 @@ function lowerCaseFirst(s) {
584
584
  return s.charAt(0).toLowerCase() + s.substr(1);
585
585
  }
586
586
  function quote(s) {
587
- return `"${s}"`;
587
+ return JSON.stringify(s);
588
588
  }
589
589
 
590
590
  // src/sections/tachyons/skins.ts
@@ -1014,7 +1014,7 @@ var TRUSS_PSEUDO_METHODS = {
1014
1014
  };
1015
1015
 
1016
1016
  // src/generate.ts
1017
- var CssProperties = imp("Properties@csstype");
1017
+ var CssProperties = imp("t:Properties@csstype");
1018
1018
  var defaultTypeAliases = {
1019
1019
  Margin: ["margin", "marginTop", "marginRight", "marginBottom", "marginLeft"],
1020
1020
  Padding: ["padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft"]
@@ -1324,7 +1324,7 @@ function omitUndefinedValues<T extends object>(value: T): T {
1324
1324
 
1325
1325
  export enum Palette {
1326
1326
  ${Object.entries(palette).map(([name, value]) => {
1327
- return `${name} = "${value}",`;
1327
+ return `${name} = ${JSON.stringify(value)},`;
1328
1328
  })}
1329
1329
  }
1330
1330
 
@@ -1386,7 +1386,7 @@ function generateWebCssBuilder(config, sections) {
1386
1386
  const breakpointCode = [
1387
1387
  `export type Breakpoint = ${Object.keys(genBreakpointsMap).map(quote).join(" | ")};`,
1388
1388
  `export enum Breakpoints {`,
1389
- ...Object.entries(genBreakpointsMap).map(([name, value]) => ` ${name} = "${value}",`),
1389
+ ...Object.entries(genBreakpointsMap).map(([name, value]) => ` ${name} = ${JSON.stringify(value)},`),
1390
1390
  `}`
1391
1391
  ];
1392
1392
  const pseudoGetterCode = Object.entries(TRUSS_PSEUDO_METHODS).map(([name, selector]) => {
@@ -1685,7 +1685,7 @@ function omitUndefinedValues<T extends object>(value: T): T {
1685
1685
 
1686
1686
  export enum Palette {
1687
1687
  ${Object.entries(palette).map(([name, value]) => {
1688
- return `${name} = "${value}",`;
1688
+ return `${name} = ${JSON.stringify(value)},`;
1689
1689
  })}
1690
1690
  }
1691
1691