motion-nice-styles

5.0.6 • Public • Published

motion-nice-styles

Turns objects into nice CSS styles. Has a few helpers:

  • Arrays to strings:
      border: [1, 'solid', '#eee']
      border: [1, #eee'] // auto adds solid
      color: [0, 0, 0, 0.5]
    
  • Transform objects: transform: { x: 0, y: 10 }
  • Color objects: background: [0, 255, 0]
  • Converts css-able functions/objects: background: chroma('#fff') // will call .css() automatically
  • Recurses into media queries + & selectors '@media screen': { ... } '& child': { ... }
  • Shorthands
    {
      borderLeftRadius: ['borderTopLeftRadius', 'borderBottomLeftRadius'],
      borderRightRadius: ['borderTopRightRadius', 'borderBottomRightRadius'],
      borderBottomRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius'],
      borderTopRadius: ['borderTopRightRadius', 'borderTopLeftRadius'],
    }
    

Readme

Keywords

none

Package Sidebar

Install

npm i motion-nice-styles

Weekly Downloads

1

Version

5.0.6

License

MIT

Last publish

Collaborators

  • steelbrain