Skip to content

Commit fd75741

Browse files
committed
fix global css in storybook
1 parent e53143a commit fd75741

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"start:fast": "cd packages/app && yarn start",
2121
"start:vscode": "cross-env VSCODE=1 yarn start:fast & cd standalone-packages/monaco-editor && yarn simpleserver & cd standalone-packages/vscode && yarn watch",
2222
"start:dynamic": "lerna run dev --scope dynamic-pages --stream",
23-
"start:common": "lerna run start --scope common --stream",
23+
"start:common": "lerna run start --scope @codesandbox/common --stream",
2424
"start:home": "yarn build:deps && yarn start:home:fast",
2525
"start:home:fast": "cd packages/homepage && yarn start",
2626
"start:test": "lerna run start:test --scope app --stream",
@@ -73,7 +73,7 @@
7373
"eslint-loader": "^1.7.1",
7474
"eslint-plugin-flowtype": "^2.34.0",
7575
"eslint-plugin-import": "^2.3.0",
76-
"eslint-plugin-jsx-a11y": "^6.1.0",
76+
"eslint-plugin-jsx-a11y": "^6.2.3",
7777
"eslint-plugin-react": "~7.4.0",
7878
"eslint-plugin-react-hooks": "^1.6.0",
7979
"flow-bin": "^0.72.0",

packages/common/.storybook/config.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1+
import React, { Fragment } from 'react';
2+
13
import { withKnobs } from '@storybook/addon-knobs';
24
import { addDecorator, addParameters, configure } from '@storybook/react';
35
import { themes } from '@storybook/theming';
46

5-
import { ThemeDecorator, withGlobal } from '../src/stories/decorators';
7+
import { ThemeDecorator } from '../src/stories/decorators';
8+
9+
import { createGlobalStyle } from 'styled-components';
10+
11+
import global from '../src/global.css';
12+
13+
const GlobalStyle = createGlobalStyle`
14+
${global}
15+
`;
16+
17+
export const withGlobal = cb => (
18+
<Fragment>
19+
<GlobalStyle />
20+
21+
{cb()}
22+
</Fragment>
23+
);
624

725
addDecorator(withKnobs);
826
addDecorator(withGlobal);
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
export * from './ThemeDecorator';
2-
export * from './withGlobal';

packages/common/src/stories/decorators/withGlobal.tsx

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)