-
Notifications
You must be signed in to change notification settings - Fork 678
Closed
Description
Hi,
I have a gatsby project where I have integrated theme-ui. Now i am trying to incorporate storybook in the project so I can develop a component library for my project.
I want my components to rely on theme-ui and the sx prop for styling but when i write stories, they render in the storybook UI without the style applied.
I am a bit lost on how to debug this.
this is what the relevant portion of my .storybook/config.js file looks like
import { configure, addDecorator } from '@storybook/react';
import React from 'react'
import { ThemeProvider } from 'theme-ui'
import theme from '../src/gatsby-plugin-theme-ui/index'
// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /\.stories\.js$/);
function loadStories() {
req.keys().forEach(filename => req(filename));
}
addDecorator((story) => (
<ThemeProvider theme={theme}>
{story()}
</ThemeProvider>
))
configure(loadStories, module);
Any help on where to start debugging this are appreciated.
Metadata
Metadata
Assignees
Labels
No labels