0.0.3 • Published 5 years ago

styled-attributes v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Styled Attributes

Styled Attributes provides functions & classes that allow for better values in styled components.

Install

npm install --save styled-attributes

Usage

Using a width

import {px} from 'styled-attributes'

let siteWidth = px(980)

let css = `
  width:${siteWidth}; // returns 980px
  padding:${px(+siteWidth * 0.01)}; // Note the +, this is required for typescript to allow the Unit class is maths.
`