Skip to content

Commit 10a5444

Browse files
committed
style: 임시 스타일링 추가
1 parent 0a2cd27 commit 10a5444

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

apps/storybook/.storybook/preview.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import type { Preview } from "@storybook/react";
2+
import { Decorator } from "@storybook/react";
23
// 중요: CSS 파일을 직접 가져옵니다
34
import 'notion-to-jsx/dist/index.css';
45

6+
// 모든 스토리에 테마 클래스를 글로벌하게 적용하는 데코레이터 추가
7+
const withTheme: Decorator = (StoryFn, context) => {
8+
const story = StoryFn(context);
9+
// DOM에 직접 테마 클래스 추가
10+
document.body.classList.add('theme_lightTheme__sq3jkbt');
11+
return story;
12+
};
13+
514
const preview: Preview = {
615
parameters: {
716
controls: {
@@ -11,6 +20,7 @@ const preview: Preview = {
1120
},
1221
},
1322
},
23+
decorators: [withTheme],
1424
};
1525

1626
export default preview;

0 commit comments

Comments
 (0)