styled-attributes
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

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.
`

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i styled-attributes

    Weekly Downloads

    2

    Version

    0.0.3

    License

    MIT

    Unpacked Size

    15.6 kB

    Total Files

    12

    Last publish

    Collaborators

    • arcath