You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Im using React context API for exposing created stitches config to the components. I want to store css in context but there is no exported type.
Describe the solution you'd like
Export css and styled types.
Describe alternatives you've considered
Im currently using typeof css operator.
The text was updated successfully, but these errors were encountered:
majidsajadi
changed the title
export type of css and styled functions
export type of css function
Apr 5, 2023
If I understood your intentions properly you can get the type of css object returned from the createStitches method by importing Stitches as default and accessing css property like this: Stitches['css'].
Because the css function & component prop is dynamic based on the configuration you pass to createStitches, it can't be provided as a static import. What I've done for my project is export a type in my stitches.config.ts:
import{CSS,createStitches}from'@stitches/react'exportconst{
styled,
css,
globalCss,
keyframes,
getCssText,
theme,
createTheme,
config,}=createStitches({/* your config here */})exporttypeCSSProp=CSS<typeofconfig>
Is your feature request related to a problem? Please describe.
Im using React context API for exposing created stitches config to the components. I want to store
css
in context but there is no exported type.Describe the solution you'd like
Export
css
andstyled
types.Describe alternatives you've considered
Im currently using
typeof css
operator.The text was updated successfully, but these errors were encountered: