JSPM

prefix-style

2.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 311057
  • Score
    100M100P100Q159672F
  • License MIT

gets a prefixed name for a css style

Package Exports

  • prefix-style

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (prefix-style) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.