Socket
Socket
Sign inDemoInstall

css-styles

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-styles

Parse and stringify inlined CSS declarations


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

css-styles

Build Status Dependency Status

NPM

Parse and stringify inlined CSS declarations

Example

const cssStyles = require('css-styles')

var styles = cssStyles.parse('background: #bada55; font-size: 12px')
console.log(styles)
// {
//   background: '#bada55',
//   fontSize: '12px'
// }

var styleString = cssStyles.stringify({position: 'absolute'})
console.log(styleString)
// 'position: absolute;'

Usage

cssStyles.parse(string)

Parse a string containing CSS declarations and returns an object. Keys will be camelCase.

cssStyles.stringify(styles={})

Convert an object containing CSS declarations in to a string. Keys will be decamelized.

Install

$ npm install css-styles

License

MIT

FAQs

Package last updated on 01 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc