File tree Expand file tree Collapse file tree 1 file changed +28
-2
lines changed
Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change 1- let camelcase = require ( 'camelcase-css' )
2-
31let UNITLESS = {
42 boxFlex : true ,
53 boxFlexGroup : true ,
@@ -33,6 +31,34 @@ function atRule(node) {
3331 }
3432}
3533
34+ // From https://github.com/hyperz111/fast-camelcase-css
35+ function camelcase ( property ) {
36+ property = property . toLowerCase ( )
37+
38+ if ( property === 'float' ) return 'cssFloat'
39+
40+ let index = property . indexOf ( '-' )
41+ // Early return if don't have a dash
42+ if ( index === - 1 ) return property
43+
44+ // Microsoft vendor-prefixes are uniquely cased
45+ if ( property . startsWith ( '-ms-' ) ) {
46+ property = property . substring ( 1 )
47+ index = property . indexOf ( '-' )
48+ }
49+
50+ let cursor = 0
51+ let result = ''
52+
53+ do {
54+ result += property . substring ( cursor , index ) + property [ index + 1 ] . toUpperCase ( )
55+ cursor = index + 2
56+ index = property . indexOf ( '-' , cursor )
57+ } while ( index !== - 1 )
58+
59+ return result + property . substring ( cursor )
60+ }
61+
3662function process ( node , options = { } ) {
3763 let name
3864 let result = { }
You can’t perform that action at this time.
0 commit comments