-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use globalCss to import more than one font face #199
Comments
Hi, I'm not sure why TS complain, Hope UI Does the font load even with the type error ? |
Can I use {globalCss} of "@stitches/core" directly? Why do we need add this method in hope-ui? |
Hope UI use |
There is a typo in the type definition.
I think |
Describe the bug
A clear and concise description of what the bug is.
I'm using globalCss to import serveral font faces.
when only one font face is includes, it is OK:
const globalStyles = globalCss({ '@font-face': { fontFamily: 'CustomFont1', src: 'local("CustomFont1"), url("CustomFont1.woff2")', }, });
when two font faces are introduces, the IDE complains wrong type, this code is as follows:
const globalStyles = globalCss({ '@font-face': [ { fontFamily: 'CustomFont1', src: 'local("CustomFont1"), url("CustomFont1.woff2")', }, { fontFamily: 'CustomFont2', src: 'local("CustomFont2"), url("CustomFont2.woff2")', }, ], });
the details info is as follows:
globalCss<{ '@font-face': unknown; }>( ...styles: {"@import"?: unknown, "@font-face"?: unknown} & {"@font-face": CSS<{sm: string, md: string, lg: string, xl: string, "2xl": string, "reduce-motion": string, light: string, dark: string}, {colors: {loContrast: string, ... 112 more ..., blackAlpha12: string}, ... 9 more ..., zIndices: {}}, {}, {}>}[]): () => string
However, if I use 'import {globalCss} from "@stitches/core"', the same code works.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
this works for hope ui.
By the way, what's the difference of between hopeUi-globalCss and stitches-globalCss?
The text was updated successfully, but these errors were encountered: