Skip to content

Commit

Permalink
New PR review comments addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
florin01hyma committed Nov 4, 2024
1 parent f354bfa commit 8169f7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-suns-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tokens-studio/sd-transforms': patch
---

-Made the font weight case insensitive; Extra checks for style and weight values, confusions cleared up in the code; Font style and value are not both mandatory, it is fine if only one is specified; If font style is not provided, the style field will take the weight value; The bug from issue #267 is fixed.
2 changes: 0 additions & 2 deletions src/transformFontWeight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export const fontWeightMap = {
extrablack: 950,
};

// fontWeight: { value: 'normal' }

export const fontStyles = ['italic', 'oblique', 'normal'];
export const fontWeightReg = new RegExp(
`(?<weight>.+?)\\s?(?<style>${fontStyles.join('|')})?$`,
Expand Down
1 change: 1 addition & 0 deletions test/spec/transformFontWeights.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ describe('transform dimension', () => {
expect(transformFontWeight({ value: '' })).to.equal('');
expect(transformFontWeight({ value: 'no_match_pattern' })).to.equal('no_match_pattern');
});

describe('composite tokens', () => {
it('should transforms letter spacing % to em in typography letterSpacing prop', () => {
expect(
Expand Down

0 comments on commit 8169f7c

Please sign in to comment.