npm.io
1.4.0 • Published 5 years ago

css-to-style

Licence
MIT
Version
1.4.0
Deps
0
Size
17 kB
Vulns
0
Weekly
0
Stars
5

css-to-style

Transform a string of css rules into a style object.

Usage

toStyle(cssText);

Parameters

  • cssText string of CSS rules
Return value

An object of CSS rules, where the properties are camelCased.

Example

import toStyle from 'css-to-style';

toStyle('font-size: 2em; color: #f00; margin-top: 4px');
// returns { fontSize: '2em', color: '#f00', marginTop: '4px' }

Keywords