-
Notifications
You must be signed in to change notification settings - Fork 104
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
preset-ant-design does't work with TypeScript #49
Comments
I just discovered that it is only the source component ( Hence it is no problem that the storybook file of |
Still a problem with the preset though, right? |
Either that or it has something to do with how Storybook consumes |
Is there any update on how to resolve this? @antonbramsen |
@SuspensionPoint to my knowledge this has not been resolved, it has however been a long time since I looked at it and the project I worked on has since then been archived, but according to a referenced commit I have to this issue, we just ended up importing the And then for overriding ant design styling we used a config-overrides.js file: const { override, fixBabelImports, addLessLoader } = require('customize-cra')
module.exports = override(
fixBabelImports('import', {
libraryName: 'antd',
libraryDirectory: 'es',
style: true,
}),
addLessLoader({
javascriptEnabled: true,
modifyVars: {
'@white': '#ffffff',
'@primary-color': '#03273B',
'@primary-color-bright': '#FFB904',
'@secondary-color-light': '#CCDDE3',
'@secondary-color-medium': '#1C7690',
'@alert': '#FF7537',
'@text-color': '@primary-color',
'@text-color-light': '@white',
'@size-base': '10px',
'@border-color-base': '@primary-color',
'@body-background': '@secondary-color-light',
'@layout-header-background': '@white',
'@layout-body-background': '@white',
'@layout-header-padding': '0',
'@item-active-bg': '@primary-color',
'@item-hover-bg': '@primary-color',
},
})
) |
What happens?
Ant Design components in Storybook does not have any styling applied to them.
It does however work if I change both the
MyComponent.tsx
andMyComponent.stories.tsx
toMyComponent.js
andMyComponent.stories.js
.I also tried adding the
preset-typescript
package which did not change anything..storybook/config.js
.storybook/presets.js
The text was updated successfully, but these errors were encountered: