@amendable/inline-props-css

0.2.2 • Public • Published

Inline Props CSS

This resolver merges all the React props that match the names of styling props into the css prop.

Usage

import { render } from 'react-dom'
import Box, { AmendableProvider } from '@amendable/core'
import inlinePropsCss from '@amendable/inline-props-css'

const resolvers = [
  inlinePropsCss(),
]

render(
  <AmendableProvider resolvers={resolvers}>
    <Box
      display="flex"
      backgroundColor="red"
      padding={64}
      paddingBottom={34}
      color="blue"
      hoverBackgroundColor="blue"
      hoverColor="red"
    >
      Amendable
    </Box>
  </AmendableProvider>
)

This will be resolved to

  <Box
    css={{
      display: 'flex',
      backgroundColor: 'red',
      padding: 64,
      paddingBottom: 34,
      color: 'blue',
      '&:hover': {
        backgroundColor: 'blue',
        color: 'red'
      }
    }}
  >
    Amendable
  </Box>

Supported props

It uses inline-style-properties underneath for prop matching.

Here are all the styling props it supports (it supports most): Supported styling properties

Readme

Keywords

none

Package Sidebar

Install

npm i @amendable/inline-props-css

Weekly Downloads

0

Version

0.2.2

License

MIT

Unpacked Size

20.9 kB

Total Files

8

Last publish

Collaborators

  • jpalumickas
  • nedomas
  • saimis