File tree Expand file tree Collapse file tree 4 files changed +49
-3
lines changed Expand file tree Collapse file tree 4 files changed +49
-3
lines changed Original file line number Diff line number Diff line change
1
+ language : node_js
2
+ sudo : false
3
+ git :
4
+ depth : 1
5
+ cache :
6
+ directories :
7
+ - $HOME/.npm
8
+ - node_modules
9
+ matrix :
10
+ include :
11
+ - node_js : ' 8'
12
+ script : npm test
13
+ env : CI=test
14
+ - node_js : ' 6'
15
+ script : npm test
16
+ env : CI=tests 6
17
+ - node_js : ' 4'
18
+ script : npm test
19
+ env : CI=tests 4
20
+ sudo : required
21
+ before_install :
22
+ - npm install -g npm@latest
Original file line number Diff line number Diff line change 1
1
# css-to-react-native-transform
2
2
3
+ [ ![ Build Status] ( https://travis-ci.org/kristerkari/css-to-react-native-transform.svg?branch=master )] ( https://travis-ci.org/kristerkari/css-to-react-native-transform )
4
+ [ ![ Build status] ( https://ci.appveyor.com/api/projects/status/75s8ls2m47by8b1x/branch/master?svg=true )] ( https://ci.appveyor.com/project/kristerkari/css-to-react-native-transform/branch/master )
5
+
3
6
A lightweight wrapper on top of
4
7
[ css-to-react-native] ( https://github.com/styled-components/css-to-react-native )
5
8
to allow valid CSS to be turned into React Native Stylesheet objects.
Original file line number Diff line number Diff line change
1
+ # http://www.appveyor.com/docs/appveyor-yml
2
+
3
+ environment :
4
+ matrix :
5
+ - nodejs_version : 5
6
+
7
+ version : " {build}"
8
+ build : off
9
+ deploy : off
10
+
11
+ install :
12
+ - ps : Install-Product node $env:nodejs_version
13
+ - npm install
14
+
15
+ test_script :
16
+ - node --version
17
+ - npm --version
18
+ - cmd : " npm test"
Original file line number Diff line number Diff line change @@ -16,15 +16,18 @@ const transform = css => {
16
16
17
17
const result = { } ;
18
18
19
- for ( const rule of stylesheet . rules ) {
20
- for ( let selector of rule . selectors ) {
19
+ for ( const r in stylesheet . rules ) {
20
+ const rule = stylesheet . rules [ r ] ;
21
+ for ( const s in rule . selectors ) {
22
+ let selector = rule . selectors [ s ] ;
21
23
selector = selector . replace ( / \. | # / g, "" ) ;
22
24
23
25
let styles ;
24
26
25
27
styles = result [ selector ] = result [ selector ] || { } ;
26
28
27
- for ( const declaration of rule . declarations ) {
29
+ for ( const d in rule . declarations ) {
30
+ const declaration = rule . declarations [ d ] ;
28
31
if ( declaration . type !== "declaration" ) continue ;
29
32
30
33
const property = declaration . property ;
You can’t perform that action at this time.
0 commit comments