Comments (5)
I just discovered that it is only the source component (MyComponent.tsx
) that needs to be either .js
or .jsx
for the preset to apply the styling.
Hence it is no problem that the storybook file of MyComponent
uses .stories.tsx
from presets.
Still a problem with the preset though, right?
from presets.
Still a problem with the preset though, right?
Either that or it has something to do with how Storybook consumes .tsx
imports when using presets (this is pure speculation though).
from presets.
Is there any update on how to resolve this? @antonbramsen
from presets.
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 antd/dist/antd.css
in the storybook config.
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',
},
})
)
from presets.
Related Issues (20)
- [Bug] CRA does not print eslint errors to terminal anylonger
- [Bug] CRA preset does not support ES2020 dependencies HOT 2
- Where are the tests for your presets?
- V3.2.0 works but V4.0.0 does not HOT 4
- [Bug] preset-create-react-app: Storybook config dir webpack override breaks default CRA config
- [Bug] Install @storybook/preset-scss with default storybook's bundler 'webpack4' doesn't works HOT 5
- [Bug] CRA5, [email protected] HOT 6
- [Bug] Fails in case of using custom folder structure inside /src
- [Help] Cannot find module '@babel/plugin-proposal-private-property-in-object'
- @storybook/preset-create-react-app 4.0.1 breaks Storybook HOT 4
- [Bug]: macos - Error: Cannot find module '.../node_modules/config/webpack.config' HOT 5
- [Bug] URL from readme does not exist on the website
- [Bug] ENAMETOOLONG on "preset-create-react-app@4" package installation HOT 1
- [Bug] start-storybook breaks when tsconfig.json has comments (preset-create-react-app)
- [Bug] Package dependency HOT 4
- [Bug] Confusing error message when stories folder is outside of src.
- [Bug] cannot run storybook with CRA preset version 4.1.0. HOT 1
- @storybook/react-docgen-typescript-plugin canary dependency
- [Bug] Storybook preset function `getReactScriptsPath` has bug HOT 2
- Missing license file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from presets.