File tree Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Expand file tree Collapse file tree 5 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -2,5 +2,6 @@ language: node_js
2
2
node_js :
3
3
- " 0.10"
4
4
- " 0.12"
5
- - " iojs"
5
+ - " 4"
6
+ - " 5"
6
7
script : npm test
Original file line number Diff line number Diff line change 1
1
# camelcase-css [ ![ NPM Version] [ npm-image ]] [ npm-url ] [ ![ Build Status] [ travis-image ]] [ travis-url ] [ ![ Dependency Status] [ david-image ]] [ david-url ]
2
+
2
3
> Convert a dash-separated CSS property to a camelCased DOM property.
3
4
4
5
5
6
## Installation
6
7
[ Node.js] ( http://nodejs.org/ ) ` >= 0.10 ` is required. Type this at the command line:
7
8
``` shell
8
- npm install camelcase-css --save-dev
9
+ npm install camelcase-css
9
10
```
10
11
11
12
12
13
## Usage
13
14
``` js
14
15
var camelCaseCSS = require (" camelcase-css" );
15
16
16
- camelCaseCSS (" -webkit-border-radius" ); // = > WebkitBorderRadius
17
- camelCaseCSS (" -moz-border-radius" ); // = > MozBorderRadius
18
- camelCaseCSS (" -ms-border-radius" ); // = > msBorderRadius
19
- camelCaseCSS (" border-radius" ); // = > borderRadius
17
+ camelCaseCSS (" -webkit-border-radius" ); // - > WebkitBorderRadius
18
+ camelCaseCSS (" -moz-border-radius" ); // - > MozBorderRadius
19
+ camelCaseCSS (" -ms-border-radius" ); // - > msBorderRadius
20
+ camelCaseCSS (" border-radius" ); // - > borderRadius
20
21
```
21
22
22
23
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ function callback(dashChar, char)
12
12
13
13
function camelCaseCSS ( property )
14
14
{
15
+ // NOTE :: IE8's "styleFloat" is intentionally not supported
16
+ if ( property === "float" ) return "cssFloat" ;
17
+
15
18
/*
16
19
Microsoft vendor-prefixed properties are camel cased
17
20
differently than other browsers:
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " camelcase-css" ,
3
3
"description" : " Convert a dash-separated CSS property to a camelCased DOM property." ,
4
- "version" : " 1.0.0 " ,
4
+ "version" : " 1.0.1 " ,
5
5
"license" : " MIT" ,
6
6
"homepage" : " https://github.com/stevenvachon/camelcase-css" ,
7
7
"author" : {
17
17
"url" : " https://github.com/stevenvachon/camelcase-css/issues"
18
18
},
19
19
"devDependencies" : {
20
- "chai" : " ^3.2 .0" ,
21
- "mocha" : " ^2.2 .5"
20
+ "chai" : " ^3.5 .0" ,
21
+ "mocha" : " ^2.4 .5"
22
22
},
23
23
"engines" : {
24
24
"node" : " >= 0.10"
Original file line number Diff line number Diff line change @@ -12,5 +12,7 @@ it("should work", function(done)
12
12
expect ( camelCaseCSS ( "-ms-border-radius" ) ) . to . equal ( "msBorderRadius" ) ;
13
13
expect ( camelCaseCSS ( "border-radius" ) ) . to . equal ( "borderRadius" ) ;
14
14
15
+ expect ( camelCaseCSS ( "float" ) ) . to . equal ( "cssFloat" ) ;
16
+
15
17
done ( ) ;
16
18
} ) ;
You can’t perform that action at this time.
0 commit comments