admin styles
the vtex admin css-in-js style parser

Summary
This package is responsible to:
- Define the VTEX admin theme structure
- Parse the StyleProp to the a emotion ObjectStyle
Installation
yarn add @vtex/admin-styles @emotion/css @emotion/react
Usage
Define a theme object that respect's the defined shape of the Theme
type, and call the styles
function:
import { styles, Theme } from '@vtex/admin-styles'
const theme: Theme = {
colors: {
dark: {
primary: 'black',
secondary: 'silver',
},
},
}
styles({
bg: 'dark.primary',
color: 'dark.secondary',
})(theme)
You can also use emotion to style your react components after parse.
import { css } from '@emotion/css'
import { styles, Theme } from '@vtex/admin-styles'
const theme: Theme = {
colors: {
dark: {
primary: 'black',
secondary: 'silver',
},
},
}
const styles = styles({
bg: 'dark.primary',
color: 'dark.secondary',
})(theme)
const className = css(styles)
render(<div className={className} />)