@madgex/design-system 6.3.11 → 7.0.0

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,4 +1,4 @@
1
- function registerTransforms(StyleDictionary, tokenBaseFontSize) {
1
+ function registerTransforms(StyleDictionary) {
2
2
  return new Promise((resolve) => {
3
3
  StyleDictionary.registerTransform({
4
4
  name: 'css/rawData',
@@ -10,33 +10,6 @@ function registerTransforms(StyleDictionary, tokenBaseFontSize) {
10
10
  return prop.rawData;
11
11
  },
12
12
  });
13
- StyleDictionary.registerTransform({
14
- name: 'custom/pxToRem',
15
- type: 'value',
16
- matcher(token) {
17
- return (
18
- token.attributes.category === 'font' && token.attributes.type === 'type' && token.attributes.state === 'size'
19
- );
20
- },
21
- transformer(token) {
22
- const baseFontSize = tokenBaseFontSize ? parseFloat(tokenBaseFontSize) : 16; // default to 16px
23
- const tokenValue = parseFloat(token.value);
24
-
25
- if (Number.isNaN(tokenBaseFontSize)) {
26
- throw new Error(`Invalid number for base font size: ${tokenBaseFontSize}`);
27
- }
28
-
29
- if (Number.isNaN(tokenValue)) {
30
- throw new Error(`Invalid number: ${token.value}. Could not convert ${token.name} to rem`);
31
- }
32
-
33
- if (tokenValue === 0) {
34
- return '0';
35
- }
36
-
37
- return `${(tokenValue / baseFontSize).toFixed(3)}rem`;
38
- },
39
- });
40
13
  resolve('Transform registered');
41
14
  });
42
15
  }