Socket
Socket
Sign inDemoInstall

prefix-style

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    prefix-style

gets a prefixed name for a css style


Version published
Weekly downloads
265K
decreased by-1.09%
Maintainers
1
Install size
4.46 kB
Created
Weekly downloads
 

Readme

Source

prefix-style

stable

For a camel case string like "transform" or "transformStyle", returns the prefixed version like "MozTransformStyle" (if necessary). Returns false if the style is unsupported.

var camel = require('to-camel-case')
var prefix = require('prefix-style')

var key = prefix(camel('transform-style'))
if (key)
    element.style[key] = 'preserve-3d'

Original implementation by Paul Irish, with some modifications by me.

Usage

NPM

prefix(prop)

Prefixes prop, a camel case string like transformStyle or fontSmoothing. Returns the prefixed camel case version (or unprefixed if the browser supports it). Returns false if the browser doesn't support it.

License

Implementation by Paul Irish.

Redistributed under MIT, see LICENSE.md for details.

Keywords

FAQs

Last updated on 30 Nov 2015

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