style-transform
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

Style Transform

A toolkit for fast and flexible manipulation of css-in-js styles.

npm install --save style-transform

Overview

Style Transform is a utility library for working with 'CSS in JS' style objects as simply as any other JS objects.

Specifically, these utilities smooth over the difficulties of working with CSS shorthand properties, as well as numeric properties provided as strings, which cause problems when working with style objects.

// given the provided style object:
// style = { margin: 20, fontSize: '16px' }
 
// returns undefined, not 20
style.marginTop;
 
// returns NaN, not 24
style.fontSize * 1.5;

Dependents (1)

Package Sidebar

Install

npm i style-transform

Weekly Downloads

1

Version

0.2.2

License

MIT

Unpacked Size

145 kB

Total Files

25

Last publish

Collaborators

  • jsiwhitehead