Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peutetre/vendor-prefix
prefix dom style
https://github.com/peutetre/vendor-prefix
Last synced: 4 months ago
JSON representation
prefix dom style
- Host: GitHub
- URL: https://github.com/peutetre/vendor-prefix
- Owner: peutetre
- Fork: true (jkroso/prefix)
- Created: 2014-01-08T23:50:45.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-01-10T10:29:12.000Z (almost 11 years ago)
- Last Synced: 2024-08-21T10:55:58.961Z (4 months ago)
- Language: JavaScript
- Size: 168 KB
- Stars: 11
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# vendor-prefix [![Build Status](https://secure.travis-ci.org/peutetre/vendor-prefix.png)](http://travis-ci.org/peutetre/vendor-prefix) [![Mocha Saucelabs Tests Status](https://saucelabs.com/buildstatus/vendor-prefix)](https://saucelabs.com/u/vendor-prefix)
add a vendor prefix to a css attribute
This is a fork from https://github.com/jkroso/prefix which is a fork of https://github.com/pgherveou/prefix
## Usage
$ npm install vendor-prefix
```js
var prefix = require('vendor-prefix');
```## API
### prefix(key)
Prefix `key`. This function memoizes its results so you don't need to worry about any performance issues, just treat it like a map.
```js
prefix('transform'); // webkitTransform
prefix('color'); // color
```Throw an error if the given string is not a css property.
### dash(key)
create a dasherize version of a vendor prefix
```js
prefix.dash('transform'); // -webkit-transform
prefix.dash('color'); // color
prefix.dash('background-color'); // background-color
```Throw an error if the given string is not a css property.
## Run the tests
$ npm install
$ npm run buildopen a browser at `test/index.html`