Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

feat(legacy-preset-big-number): use emotion styling #455

Merged
merged 19 commits into from
May 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/superset-ui-demo/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import sequentialD3 from '@superset-ui/color/esm/colorSchemes/sequential/d3';
import { configure } from '@superset-ui/translation';
import { getCategoricalSchemeRegistry, getSequentialSchemeRegistry } from '@superset-ui/color';
import { getTimeFormatterRegistry, smartDateFormatter } from '@superset-ui/time-format';
import themeDecorator from "./themeDecorator"

import 'bootstrap/dist/css/bootstrap.min.css';
import './storybook.css';

addDecorator(jsxDecorator);
addDecorator(themeDecorator);

addParameters({
options: {
Expand Down
10 changes: 10 additions & 0 deletions packages/superset-ui-demo/.storybook/themeDecorator.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// themeDecorator.js
import React from "react"
import { ThemeProvider } from 'emotion-theming';
import { supersetTheme } from '@superset-ui/style';

const ThemeDecorator = storyFn => (
<ThemeProvider theme={supersetTheme}>{storyFn()}</ThemeProvider>
)

export default ThemeDecorator
2 changes: 2 additions & 0 deletions packages/superset-ui-style/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ class App extends React.Component {
}
}
```

Note: the `ThemeProvider` is already included in the project's `Storybook` (as a decorator) meaning you should be able to apply/view any new Emotion-based theme attributes and see them reflected in the storybook without any additional setup.
Loading