Skip to content

mattdesl/prefix-style

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

gets a prefixed name for a css style

Resources

License

Stars

Watchers

Forks

Packages

No packages published