@servicetitan/hammer-token 1.3.5 → 1.3.6

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @servicetitan/hammer-token@1.3.5 build /home/runner/work/hammer/hammer/packages/hammer-token
2
+ > @servicetitan/hammer-token@1.3.6 build /home/runner/work/hammer/hammer/packages/hammer-token
3
3
  > node ./config.js
4
4
 
5
5
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @servicetitan/hammer-token
2
2
 
3
+ ## 1.3.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#913](https://github.com/servicetitan/hammer/pull/913) [`3246da5`](https://github.com/servicetitan/hammer/commit/3246da57b0b41ad823acf6c45fa4bea0fe8fca84) Thanks [@tounsoo](https://github.com/tounsoo)! - Fix font family base not using CSS variables
8
+
3
9
  ## 1.3.5
4
10
 
5
11
  ### Patch Changes
@@ -77,6 +77,8 @@ $token: (
77
77
  duration-instant: 0ms,
78
78
  duration-fast: 100ms,
79
79
  duration-slow: 300ms,
80
+ font-family-base: "'Nunito Sans', sans-serif",
81
+ font-family-display: "'Sofia Pro', SofiaPro, sans-serif",
80
82
  font-line-height-base: 1.5,
81
83
  font-line-height-display: 1.25,
82
84
  font-weight-normal: 400,
@@ -76,8 +76,8 @@ $duration: 200ms;
76
76
  $duration-instant: 0ms;
77
77
  $duration-fast: 100ms;
78
78
  $duration-slow: 300ms;
79
- $font-family-base: 'Nunito Sans', sans-serif;
80
- $font-family-display: 'Sofia Pro', SofiaPro, sans-serif;
79
+ $font-family-base: var(--font-family-base, 'Nunito Sans', sans-serif);
80
+ $font-family-display: var(--font-family-display, 'Sofia Pro', SofiaPro, sans-serif);
81
81
  $font-line-height-base: 1.5;
82
82
  $font-line-height-display: 1.25;
83
83
  $font-weight-normal: 400;
@@ -107,16 +107,19 @@ $nonColor: (
107
107
  typography-paragraph-size-large: 1.25rem,
108
108
  typography-paragraph-size-xlarge: 1.5rem,
109
109
  typography-paragraph-font-weight: 400,
110
+ typography-paragraph-font-family: "'Nunito Sans', sans-serif",
110
111
  typography-heading-size-xsmall: 0.875rem,
111
112
  typography-heading-size-small: 1rem,
112
113
  typography-heading-size: 1.25rem,
113
114
  typography-heading-size-large: 1.5rem,
114
115
  typography-heading-size-xlarge: 2rem,
115
116
  typography-heading-font-weight: 700,
117
+ typography-heading-font-family: "'Sofia Pro', SofiaPro, sans-serif",
116
118
  typography-label-size-xsmall: 0.625rem,
117
119
  typography-label-size-small: 0.75rem,
118
120
  typography-label-size: 0.875rem,
119
121
  typography-label-size-large: 1rem,
120
122
  typography-label-size-xlarge: 1.25rem,
121
123
  typography-label-font-weight: 600,
124
+ typography-label-font-family: "'Nunito Sans', sans-serif",
122
125
  );
@@ -59,18 +59,18 @@ $typography-paragraph-size: 1rem;
59
59
  $typography-paragraph-size-large: 1.25rem;
60
60
  $typography-paragraph-size-xlarge: 1.5rem;
61
61
  $typography-paragraph-font-weight: 400;
62
- $typography-paragraph-font-family: 'Nunito Sans', sans-serif;
62
+ $typography-paragraph-font-family: var(--typography-paragraph-font-family, 'Nunito Sans', sans-serif);
63
63
  $typography-heading-size-xsmall: 0.875rem;
64
64
  $typography-heading-size-small: 1rem;
65
65
  $typography-heading-size: 1.25rem;
66
66
  $typography-heading-size-large: 1.5rem;
67
67
  $typography-heading-size-xlarge: 2rem;
68
68
  $typography-heading-font-weight: 700;
69
- $typography-heading-font-family: 'Sofia Pro', SofiaPro, sans-serif;
69
+ $typography-heading-font-family: var(--typography-heading-font-family, 'Sofia Pro', SofiaPro, sans-serif);
70
70
  $typography-label-size-xsmall: 0.625rem;
71
71
  $typography-label-size-small: 0.75rem;
72
72
  $typography-label-size: 0.875rem;
73
73
  $typography-label-size-large: 1rem;
74
74
  $typography-label-size-xlarge: 1.25rem;
75
75
  $typography-label-font-weight: 600;
76
- $typography-label-font-family: 'Nunito Sans', sans-serif;
76
+ $typography-label-font-family: var(--typography-label-font-family, 'Nunito Sans', sans-serif);
package/config.js CHANGED
@@ -17,6 +17,8 @@ StyleDictionary.registerFormat({
17
17
  .map((token) => {
18
18
  let value = token.value;
19
19
  let name = `${token.name.replace("-default", "")}`;
20
+ if (token.name.includes("font-family"))
21
+ return `$${name}: var(--${name}, ${value});`;
20
22
  if (token.attributes.appearance) {
21
23
  return `$${name}: var(--${name}, ${value});`;
22
24
  }
@@ -82,12 +84,12 @@ StyleDictionary.registerFormat({
82
84
  isColor = false;
83
85
  }
84
86
  });
85
- if (token.name.includes("font-family")) return false;
86
87
  return !isColor;
87
88
  })
88
89
  .map((token) => {
89
90
  let value = token.value;
90
91
  let name = `${token.name.replace("-default", "")}`;
92
+ if (token.name.includes("font-family")) return ` ${name}: "${value}",`;
91
93
  return ` ${name}: ${value},`;
92
94
  })
93
95
  .join(`\n`);
@@ -110,10 +112,10 @@ StyleDictionary.registerFormat({
110
112
  name: `custom/primitive-variables`,
111
113
  formatter: function ({ dictionary }) {
112
114
  const vars = dictionary.allTokens
113
- .filter((token) => !token.name.includes("font-family"))
114
115
  .map((token) => {
115
116
  let value = token.value;
116
117
  let name = `${token.name.replace("-default", "")}`;
118
+ if (token.name.includes("font-family")) return ` ${name}: "${value}",`;
117
119
  return ` ${name}: ${value},`;
118
120
  })
119
121
  .join(`\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/hammer-token",
3
- "version": "1.3.5",
3
+ "version": "1.3.6",
4
4
  "description": "",
5
5
  "main": "build/web/index.js",
6
6
  "types": "build/web/index.d.ts",