Skip to content

Commit

Permalink
fix(stitchesjs#943): TS @font-face descriptors
Browse files Browse the repository at this point in the history
  • Loading branch information
drianoaz committed Mar 9, 2022
1 parent 0ebaf9f commit c381e18
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/core/tests/issue-943.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { createStitches } from '../src/index.js'

describe('Issue #943', () => {
test('locally scoped token works 1 time', () => {
const { globalCss, getCssText } = createStitches()

globalCss({
'@font-face': [
{
fontFamily: 'fallback-font',
ascentOverride: '83.6%',
descentOverride: '20.5%',
lineGapOverride: '0%',
advanceOverride: '10',
src: 'local(Arial)',
}
]
})()

expect(getCssText()).toBe('--sxs{--sxs:1 jGZRm}@media{@font-face{font-family:fallback-font;ascent-override:83.6%;descent-override:20.5%;line-gap-override:0%;advance-override:10;src:local(Arial)}}')
})
})
6 changes: 6 additions & 0 deletions packages/core/types/css.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9303,6 +9303,9 @@ export namespace AtRule {
fontWeight?: FontWeight;
src?: string;
unicodeRange?: string;
sizeAdjust?: string;
ascentOverride?: string;
descentOverride?: string;
}

export interface FontFaceHyphen {
Expand All @@ -9316,6 +9319,9 @@ export namespace AtRule {
"font-weight"?: FontWeight;
src?: string;
"unicode-range"?: string;
"size-adjust"?: string;
"ascent-override"?: string;
"descent-override"?: string;
}

export type FontFaceFallback = {
Expand Down

0 comments on commit c381e18

Please sign in to comment.