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
Hi all,
I'm currently working on a Drupal theme with the use of Storybook. What I want to do is create a basetheme in Drupal (in which Storybook resides) and let the users generate a child-theme. This enables them to create overrides for e.g. colours, etc. defined in the basetheme.
But to prevent them having to clone the whole Storybook instance for each and every childtheme, I was wondering if it is possible to start Storybook with additional configuration directories (or something like that).
I'm using the @storybook/addon-themes addon for theme configuration (withThemeByClassName) and import the CSS directly in the preview.
The directory structure is as follows:
/basetheme
/.storybook
/main.ts
/preview.ts
/styling-for-theme.css
/all the other files and directories
/childtheme
/styling-for-childtheme.css
So what I hope to accomplish is that I can add a configuration file in the childtheme (e.g. storybook-preview.js) with additional themenames for withThemeByClassName and CSS import, start Storybook and add this child configuration to the preview.
Now the question remains: is this even possible? Should I alter the main preview.ts to scan for other themes for additional configuration or can I start Storybook with a parameter that it can include the additional configuration?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Summary
Hi all,
I'm currently working on a Drupal theme with the use of Storybook. What I want to do is create a basetheme in Drupal (in which Storybook resides) and let the users generate a child-theme. This enables them to create overrides for e.g. colours, etc. defined in the basetheme.
But to prevent them having to clone the whole Storybook instance for each and every childtheme, I was wondering if it is possible to start Storybook with additional configuration directories (or something like that).
I'm using the @storybook/addon-themes addon for theme configuration (withThemeByClassName) and import the CSS directly in the preview.
The directory structure is as follows:
/basetheme
/.storybook
/main.ts
/preview.ts
/styling-for-theme.css
/all the other files and directories
/childtheme
/styling-for-childtheme.css
So what I hope to accomplish is that I can add a configuration file in the childtheme (e.g. storybook-preview.js) with additional themenames for withThemeByClassName and CSS import, start Storybook and add this child configuration to the preview.
Now the question remains: is this even possible? Should I alter the main preview.ts to scan for other themes for additional configuration or can I start Storybook with a parameter that it can include the additional configuration?
Additional information
No response
Create a reproduction
No response
Beta Was this translation helpful? Give feedback.
All reactions