mirror of
https://github.com/IT4Change/boilerplate-frontend.git
synced 2025-12-13 07:35:53 +00:00
22 lines
624 B
TypeScript
22 lines
624 B
TypeScript
// .storybook/withVeutifyTheme.decorator.js
|
|
import { h } from 'vue';
|
|
import StoryWrapper from './StoryWrapper.vue';
|
|
|
|
export const DEFAULT_THEME = 'light';
|
|
|
|
export const withVuetifyTheme = (storyFn, context) => {
|
|
// Pull our global theme variable, fallback to DEFAULT_THEME
|
|
const themeName = context.globals.theme || DEFAULT_THEME;
|
|
const story = storyFn();
|
|
|
|
return () => {
|
|
return h(
|
|
StoryWrapper,
|
|
{ themeName }, // Props for StoryWrapper
|
|
{
|
|
// Puts your story into StoryWrapper's "story" slot with your story args
|
|
story: () => h(story, { ...context.args }),
|
|
}
|
|
);
|
|
};
|
|
}; |