mirror of
https://github.com/apache/superset.git
synced 2024-09-19 20:19:37 -04:00
b6931fbcd6
* chore(release): publish v0.13.7 * Revert "chore(release): publish v0.13.7" This reverts commit 3c9ce9ed4c46f9a52fd78bd9b43732803e93c0ac. * Revert "chore(release): publish v0.13.6" This reverts commit 0e6e829beba0df62a717601b20fdd790ebf49714. * feat: poc using style package in big-number * ThemeProvider decorator * removing other themeProvider stuff (no longer needed) * just adding a note to the readme that this stuff works out of the box. * bumps n deps * BigNumber using theme bits... in theory * wordCloud using theme bits * bumping packages again * fixing dependencies * moving style package to peer deps to fix some SUPER annoying errors * nixing css style, to let Emotion do the talking * moving wordCloud to style pkg to peerDeps. * Nixing CSS file, putting all the styles in one place at export * condensing imports * nixing extraneous package * getting emotion stuff out of word cloud for now (that's another PR!) Co-authored-by: David Aaron Suddjian <aasuddjian@gmail.com> |
||
---|---|---|
.. | ||
src | ||
test | ||
package.json | ||
README.md |
@superset-ui/style
Provides a style object containing a variety of style parameters for theming Superset components with Emotion. See SIP-37 for additional context. This will eventually allow for custom themes to override default Superset styles. These parameters (and the styled-components/emotion design pattern) will, over time, be used to whittle away at widely-scoped LESS styles, making it easier to build and (re)style Superset components.
Usage
import { ThemeProvider } from 'emotion-theming';
import styled, { supersetTheme } from '@superset-ui/style';
// use emotion api as normal, but the theme uses the correct types
const MyHeader = styled.h1`
color: ${props => props.theme.colors.primary.base};
font-family: sans-serif;
`
class App extends React.Component {
render() {
return (
<ThemeProvider theme={supersetTheme}>
<MyHeader>Properly styled text!</MyHeader>
</ThemeProvider>
);
}
}
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.