-
In CSS @font-face {
src: url(font1.ttf);
font-weight: 400;
}
@font-face {
src: url(font2.ttf);
font-weight: 700;
} which would naturally switch between font1 and font2 when using a Anybody has a clue how to achieve this? Thanks a lot all! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
It seems doable with the |
Beta Was this translation helpful? Give feedback.
-
I'm also looking for this behavior for For now, I've settled to use Perhaps it might be nice to be able to provide an array to const myFont = fontFace([
{
src: `local('My Font')`,
fontStyle: 'normal',
},
{
src: `local('My Font Italic')`,
fontStyle: 'italic',
},
]); |
Beta Was this translation helpful? Give feedback.
-
I'm using like this the font-face and I don't have any problems import { globalFontFace } from '@vanilla-extract/css';
globalFontFace('Plus Jakarta Sans', {
fontWeight: 400,
src: `url('/assets/fonts/PlusJakartaSans/PlusJakartaSans-Regular.ttf') format('truetype')`,
});
globalFontFace('Plus Jakarta Sans', {
fontWeight: 700,
src: `url('/assets/fonts/PlusJakartaSans/PlusJakartaSans-Bold.ttf') format('truetype')`,
}); |
Beta Was this translation helpful? Give feedback.
-
Just submitted a PR that would allow |
Beta Was this translation helpful? Give feedback.
-
I believe both #1114 and #1379 adequately support these use cases. |
Beta Was this translation helpful? Give feedback.
I believe both #1114 and #1379 adequately support these use cases.