css-to-style
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/css-to-style package

1.4.0 • Public • Published

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' }

Package Sidebar

Install

npm i css-to-style

Weekly Downloads

5,208

Version

1.4.0

License

MIT

Unpacked Size

17.7 kB

Total Files

8

Last publish

Collaborators

  • jacobbuck