@salty-css/core 0.1.0-alpha.21 → 0.1.0-alpha.22

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.
@@ -49,7 +49,7 @@ const quoteFamily = (name) => {
49
49
  const buildFontFamilyValue = (name, fallback) => {
50
50
  const head = quoteFamily(name);
51
51
  if (!fallback || fallback.length === 0) return head;
52
- return [head, ...fallback].join(", ");
52
+ return [head, fallback].join(", ");
53
53
  };
54
54
  const formatSrc = (src) => {
55
55
  const parts = [`url("${src.url}")`];
@@ -118,10 +118,7 @@ class FontFactory {
118
118
  blocks.push(variantToFontFace(this._options.name, variant, display));
119
119
  }
120
120
  }
121
- blocks.push(
122
- `:root { ${this.variable}: ${this.fontFamily}; }`,
123
- `.${this.className} { ${this.variable}: ${this.fontFamily}; font-family: var(${this.variable}); }`
124
- );
121
+ blocks.push(`:root { ${this.variable}: ${this.fontFamily}; }`, `.${this.className} { font-family: var(${this.variable}); }`);
125
122
  return { imports, body: blocks.join(" ") };
126
123
  }
127
124
  }
@@ -47,7 +47,7 @@ const quoteFamily = (name) => {
47
47
  const buildFontFamilyValue = (name, fallback) => {
48
48
  const head = quoteFamily(name);
49
49
  if (!fallback || fallback.length === 0) return head;
50
- return [head, ...fallback].join(", ");
50
+ return [head, fallback].join(", ");
51
51
  };
52
52
  const formatSrc = (src) => {
53
53
  const parts = [`url("${src.url}")`];
@@ -116,10 +116,7 @@ class FontFactory {
116
116
  blocks.push(variantToFontFace(this._options.name, variant, display));
117
117
  }
118
118
  }
119
- blocks.push(
120
- `:root { ${this.variable}: ${this.fontFamily}; }`,
121
- `.${this.className} { ${this.variable}: ${this.fontFamily}; font-family: var(${this.variable}); }`
122
- );
119
+ blocks.push(`:root { ${this.variable}: ${this.fontFamily}; }`, `.${this.className} { font-family: var(${this.variable}); }`);
123
120
  return { imports, body: blocks.join(" ") };
124
121
  }
125
122
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/core",
3
- "version": "0.1.0-alpha.21",
3
+ "version": "0.1.0-alpha.22",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -37,8 +37,8 @@ interface DefineFontBase {
37
37
  variable?: string;
38
38
  /** Default `font-display` applied to variants that don't set their own. */
39
39
  display?: FontDisplay;
40
- /** Family fallbacks appended after `name` in the generated `font-family` string. */
41
- fallback?: string[];
40
+ /** Family fallback(s) appended after `name` in the generated `font-family` string. */
41
+ fallback?: string;
42
42
  }
43
43
  export interface DefineFontVariantsOptions extends DefineFontBase {
44
44
  variants: FontVariant[];