Socket
Socket
Sign inDemoInstall

hyphenate-style-name

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hyphenate-style-name

Hyphenates a camelcased CSS property name


Version published
Weekly downloads
4.3M
decreased by-0.15%
Maintainers
1
Install size
5.47 kB
Created
Weekly downloads
 

Package description

What is hyphenate-style-name?

The hyphenate-style-name package is a small, focused utility designed for converting JavaScript style object keys from camelCase to hyphenated-case. This is particularly useful when working with CSS in JavaScript solutions, where you might need to convert style objects into a format that can be used directly in stylesheets or inline styles.

What are hyphenate-style-name's main functionalities?

Hyphenating Style Names

Converts JavaScript style object keys from camelCase (e.g., 'marginLeft') to hyphenated-case (e.g., 'margin-left'). This is useful for dynamically generating CSS styles in JavaScript.

"marginLeft" => "margin-left"

Other packages similar to hyphenate-style-name

Readme

Source

hyphenate-style-name

npm versionnpmnpm bundle sizeBuild Status

Hyphenates a camelcased CSS property name. For example:

  • backgroundColor => background-color
  • MozTransition => -moz-transition
  • msTransition => -ms-transition
  • color => color

Installation

$ npm install --save hyphenate-style-name

Usage

var hyphenateStyleName = require('hyphenate-style-name')

console.log(hyphenateStyleName('MozTransition')) // -moz-transition

License

BSD-3-Clause licensed. See LICENSE.

Keywords

FAQs

Last updated on 13 Jul 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc