superset/superset-frontend/temporary_superset_ui/superset-ui/packages/superset-ui-style
Evan Rusackas b6931fbcd6 feat(legacy-preset-big-number): use emotion styling (#455)
* 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>
2021-11-26 11:46:18 +08:00
..
src feat(style): adding typographic variables to theme (#463) 2021-11-26 11:46:14 +08:00
test fix: export superset theme props (#391) 2021-11-26 11:46:08 +08:00
package.json chore: publish v0.13.11 2021-11-26 11:46:15 +08:00
README.md feat(legacy-preset-big-number): use emotion styling (#455) 2021-11-26 11:46:18 +08:00

@superset-ui/style

Version David (path)

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.