-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
createFontStack: Ensure provided
size-adjust
is factored into overr…
…ides (#199)
- Loading branch information
1 parent
f55acae
commit 630a5fe
Showing
3 changed files
with
53 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,37 @@ | ||
--- | ||
'@capsizecss/core': patch | ||
--- | ||
|
||
createFontStack: Ensure provided \`size-adjust\` is factored into metric overrides | ||
|
||
Ensures a custom `size-adjust` value provided via the `fontFaceProperties` option is factored into the calculations for the metric overrides. | ||
|
||
#### Example | ||
|
||
If a custom `size-adjust` value is provided: | ||
|
||
```ts | ||
createFontStack( | ||
[ merriweatherSans, arial ], | ||
{ | ||
fontFaceProperties: { | ||
sizeAdjust: '300%' | ||
} | ||
}, | ||
) | ||
``` | ||
|
||
The resulting metric overrides are now adjusted accordingly: | ||
|
||
```diff | ||
@font-face { | ||
font-family: "Merriweather Sans Fallback"; | ||
src: local('Arial'); | ||
- ascent-override: 92.3409%; | ||
+ ascent-override: 32.8%; | ||
- descent-override: 25.619%; | ||
+ descent-override: 9.1%; | ||
line-gap-override: 0%; | ||
size-adjust: 300%; | ||
} | ||
``` |
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