Intellisense for custom CSS properties from utils #701
-
my expectation is the custom css properties from const { getCssString, styled } = createCss ({
theme: {
space: {
....
}
},
utils: {
mx: config => value => ({
marginLeft: value,
marginRight: value,
}),
}
})
const Box = styled('div', {
variants: {
marginX: {
auto: {
mx: '', // should show the space option like regular margin properties
},
},
},
}); any idea how to make intelisense working on it? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello, afaik you need to type value. Try following: utils: {
mx: config => (value: `$${keyof typeof config['theme']['space']}` | (string & {})) => ({
marginLeft: value,
marginRight: value,
}),
} |
Beta Was this translation helpful? Give feedback.
-
This isn't something that can magically work, but we're working on exposing types to make this easier. WIP migration guide for v1 https://stitches-site-git-v1.modulz-deploys.com/blog/migrating-from-beta-to-v1 |
Beta Was this translation helpful? Give feedback.
This isn't something that can magically work, but we're working on exposing types to make this easier. WIP migration guide for v1 https://stitches-site-git-v1.modulz-deploys.com/blog/migrating-from-beta-to-v1