-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: change name fontWeight transform, add some tests, update docs
- Loading branch information
1 parent
6b32383
commit 2731a5e
Showing
6 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'@tokens-studio/sd-transforms': patch | ||
--- | ||
|
||
Add value transform `ts/typography/css/fontFamily` to font-families which adds quotes if it has white space. The source | ||
value will then match with how it's rendered in the composite typography token value. `outputReferences: true` will now replace | ||
the quoted value with the reference. Previously, the reference was wrapped in quotes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@tokens-studio/sd-transforms': minor | ||
--- | ||
|
||
BREAKING: change name of ts/type/fontWeight transform to -> ts/typography/fontWeight, for consistency's sake. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { expect } from '@esm-bundle/chai'; | ||
import { processFontFamily } from '../../../src/css/transformTypography.js'; | ||
|
||
describe('process font family', () => { | ||
it('transforms font-family to have single quotes around multi-word font-families', () => { | ||
expect(processFontFamily('')).to.equal(`sans-serif`); | ||
expect(processFontFamily('Arial, sans-serif')).to.equal(`Arial, sans-serif`); | ||
expect(processFontFamily('Arial Black, sans-serif')).to.equal(`'Arial Black', sans-serif`); | ||
expect(processFontFamily('Arial Black, Times New Roman, Foo, sans-serif')).to.equal( | ||
`'Arial Black', 'Times New Roman', Foo, sans-serif`, | ||
); | ||
expect(processFontFamily(`'Arial Black', Times New Roman, Foo, sans-serif`)).to.equal( | ||
`'Arial Black', 'Times New Roman', Foo, sans-serif`, | ||
); | ||
}); | ||
}); |