@emotion/provider
A provider component to provide options to emotion and allow theming
Last updated 9 years ago by mitchellhamilton .
MIT · Repository · Original npm · Tarball · package.json
$ npm install @emotion/provider 
SYNC missed versions from official npm registry.

@emotion/provider

A React component to provide a theme to child components

Install

yarn add @emotion/provider

Usage

/** @jsx jsx */
import { jsx } from '@emotion/jsx'
import styled from '@emotion/styled'
import * as React from 'react'
import ThemeProvider from '@emotion/provider'

let SomeParagraph = styled.p`
  color: ${props => props.theme.primaryColor};
`

class SomeComponent extends React.Component {
  constructor(props) {
    super(props)
    this.state = {
      theme: {
        primaryColor: 'hotpink'
      }
    }
  }
  render() {
    return (
      <ThemeProvider theme={this.state.theme}>
        <h1 css={theme => ({ color: theme.primaryColor })}>some heading</h1>
        <SomeParagraph>some text</SomeParagraph>
      </ThemeProvider>
    )
  }
}

Current Tags

  • 0.11.2                                ...           latest (8 years ago)

26 Versions

  • 0.11.2                                ...           8 years ago
  • 0.11.1                                ...           8 years ago
  • 0.11.0                                ...           8 years ago
  • 0.10.0                                ...           8 years ago
  • 0.9.3                                ...           8 years ago
  • 0.9.2                                ...           8 years ago
  • 0.9.1                                ...           8 years ago
  • 0.9.0                                ...           9 years ago
  • 0.8.0                                ...           9 years ago
  • 0.7.2                                ...           9 years ago
  • 0.7.1                                ...           9 years ago
  • 0.7.0                                ...           9 years ago
  • 0.6.5                                ...           9 years ago
  • 0.6.4                                ...           9 years ago
  • 0.6.3                                ...           9 years ago
  • 0.6.2                                ...           9 years ago
  • 0.6.0                                ...           9 years ago
  • 0.5.0                                ...           9 years ago
  • 0.4.1                                ...           9 years ago
  • 0.4.0                                ...           9 years ago
  • 0.3.0                                ...           9 years ago
  • 0.2.3                                ...           9 years ago
  • 0.2.1                                ...           9 years ago
  • 0.2.0                                ...           9 years ago
  • 0.0.5                                ...           9 years ago
  • 0.0.4                                ...           9 years ago
Downloads
Total 71
Today 0
This Week 0
This Month 71
Last Day 0
Last Week 53
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None

© 2010 - cnpmjs.org x YWFE | Home | YWFE