From 5cda3508a50d5580f5c7270b27d78f759c26316f Mon Sep 17 00:00:00 2001 From: Bryan de Jong Date: Mon, 16 Dec 2024 12:32:25 +0100 Subject: [PATCH 1/2] feat: enable tokens studio transform group for voorbeeld thema --- .changeset/hungry-pandas-refuse.md | 7 +++++++ style-dictionary-config.js | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/hungry-pandas-refuse.md diff --git a/.changeset/hungry-pandas-refuse.md b/.changeset/hungry-pandas-refuse.md new file mode 100644 index 000000000..d1789a037 --- /dev/null +++ b/.changeset/hungry-pandas-refuse.md @@ -0,0 +1,7 @@ +--- +"@nl-design-system-community/purmerend-design-tokens": patch +"@nl-design-system-unstable/voorbeeld-design-tokens": patch +"@nl-design-system-unstable/basis-design-tokens": patch +--- + +Convert percentages to unitless line-height values in the theme output. diff --git a/style-dictionary-config.js b/style-dictionary-config.js index 2946b3785..ec5cd42a2 100644 --- a/style-dictionary-config.js +++ b/style-dictionary-config.js @@ -8,11 +8,11 @@ const createConfig = ({ source = ['src/**/tokens.json', 'src/**/*.tokens.json'], buildPath = 'dist/', className = '', - useTokensStudioTransformGroup = false, + useTokensStudioTransformGroup = true, }) => { const prefix = selector ? selector.replace(/^\.(.+)-theme/, '$1') : ''; let themeName = className || (prefix ? `${prefix}-theme` : 'theme'); - const transformGroup = useTokensStudioTransformGroup ? 'tokens-studio' : ''; + const transformGroup = useTokensStudioTransformGroup && !backwardsCompatible ? 'tokens-studio' : ''; const legacyPlatforms = { legacyJson: { From e6e7c45f87a33e776775c27e772de6022c38762a Mon Sep 17 00:00:00 2001 From: Bryan de Jong Date: Mon, 16 Dec 2024 12:49:09 +0100 Subject: [PATCH 2/2] chore: update color notation in tests --- packages/theme-toolkit/src/style-dictionary.test.ts | 6 +++--- packages/tokens-lib/src/style-dictionary.test.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/theme-toolkit/src/style-dictionary.test.ts b/packages/theme-toolkit/src/style-dictionary.test.ts index 429de024e..8bef7d88d 100644 --- a/packages/theme-toolkit/src/style-dictionary.test.ts +++ b/packages/theme-toolkit/src/style-dictionary.test.ts @@ -196,7 +196,7 @@ const testDirectory = (distPath: string) => { }); it('contains a variable assignment', () => { - expect(content).toContain('"utrechtButtonColor": "#0A2750"'); + expect(content).toContain('"utrechtButtonColor": "#0a2750"'); }); }); }); @@ -264,7 +264,7 @@ const testDirectory = (distPath: string) => { }); it('contains a property assignment', () => { - expect(content).toContain('"utrechtButtonColor": "#0A2750"'); + expect(content).toContain('"utrechtButtonColor": "#0a2750"'); }); }); }); @@ -296,7 +296,7 @@ const testDirectory = (distPath: string) => { }); it.skip('contains a property assignment', () => { - expect(content).toContain('"value": "#0A2750"'); + expect(content).toContain('"value": "#0a2750"'); }); }); }); diff --git a/packages/tokens-lib/src/style-dictionary.test.ts b/packages/tokens-lib/src/style-dictionary.test.ts index 429de024e..8bef7d88d 100644 --- a/packages/tokens-lib/src/style-dictionary.test.ts +++ b/packages/tokens-lib/src/style-dictionary.test.ts @@ -196,7 +196,7 @@ const testDirectory = (distPath: string) => { }); it('contains a variable assignment', () => { - expect(content).toContain('"utrechtButtonColor": "#0A2750"'); + expect(content).toContain('"utrechtButtonColor": "#0a2750"'); }); }); }); @@ -264,7 +264,7 @@ const testDirectory = (distPath: string) => { }); it('contains a property assignment', () => { - expect(content).toContain('"utrechtButtonColor": "#0A2750"'); + expect(content).toContain('"utrechtButtonColor": "#0a2750"'); }); }); }); @@ -296,7 +296,7 @@ const testDirectory = (distPath: string) => { }); it.skip('contains a property assignment', () => { - expect(content).toContain('"value": "#0A2750"'); + expect(content).toContain('"value": "#0a2750"'); }); }); });