File tree 3 files changed +15
-9
lines changed
3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -8,13 +8,16 @@ const input = {
8
8
height : '50@vs' ,
9
9
margin : {
10
10
width : 12 ,
11
- height : '12@s'
11
+ height : '12@s' ,
12
+ paddingBottom : - 1
12
13
}
13
14
} ,
14
15
row : {
15
16
padding : '10@ms0.3' ,
16
17
height : '34@ms' ,
17
- margin : '0.5@ms0.9'
18
+ marginRight : '0.5@ms0.9' ,
19
+ marginLeft : '-0.5@ms0.9' ,
20
+ marginTop : '-10@s' ,
18
21
}
19
22
} ;
20
23
@@ -24,13 +27,16 @@ const expectedOutput = {
24
27
height : verticalScale ( 50 ) ,
25
28
margin : {
26
29
width : 12 ,
27
- height : scale ( 12 )
30
+ height : scale ( 12 ) ,
31
+ paddingBottom : - 1
28
32
}
29
33
} ,
30
34
row : {
31
35
padding : moderateScale ( 10 , 0.3 ) ,
32
36
height : moderateScale ( 34 ) ,
33
- margin : moderateScale ( 0.5 , 0.9 )
37
+ marginRight : moderateScale ( 0.5 , 0.9 ) ,
38
+ marginLeft : moderateScale ( - 0.5 , 0.9 ) ,
39
+ marginTop : scale ( - 10 ) ,
34
40
}
35
41
} ;
36
42
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import { StyleSheet } from 'react-native';
2
2
import { moderateScale , scale , verticalScale } from './scalingUtils' ;
3
3
import deepMap from './deepMap' ;
4
4
5
- const validScaleSheetRegex = / ^ ( \d + ( \. \d { 1 , 2 } ) ? ) @ ( m s ( \d + ( \. \d { 1 , 2 } ) ? ) ? | s | v s ) $ / ;
6
- const scaleRegex = / ^ ( \d + ( \. \d { 1 , 2 } ) ? ) @ s $ / ;
7
- const verticalScaleRegex = / ^ ( \d + ( \. \d { 1 , 2 } ) ? ) @ v s $ / ;
8
- const moderateScaleRegex = / ^ ( \d + ( \. \d { 1 , 2 } ) ? ) @ m s ( \d + ( \. \d { 1 , 2 } ) ? ) ? $ / ;
5
+ const validScaleSheetRegex = / ^ ( \- ? \ d+ ( \. \d { 1 , 2 } ) ? ) @ ( m s ( \d + ( \. \d { 1 , 2 } ) ? ) ? | s | v s ) $ / ;
6
+ const scaleRegex = / ^ ( \- ? \ d+ ( \. \d { 1 , 2 } ) ? ) @ s $ / ;
7
+ const verticalScaleRegex = / ^ ( \- ? \ d+ ( \. \d { 1 , 2 } ) ? ) @ v s $ / ;
8
+ const moderateScaleRegex = / ^ ( \- ? \ d+ ( \. \d { 1 , 2 } ) ? ) @ m s ( \d + ( \. \d { 1 , 2 } ) ? ) ? $ / ;
9
9
10
10
const scaleByAnnotation = ( value ) => {
11
11
if ( ! validScaleSheetRegex . test ( value ) ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-size-matters" ,
3
- "version" : " 0.1.2 " ,
3
+ "version" : " 0.1.3 " ,
4
4
"description" : " A React-Native utility belt for scaling the size your apps UI across different sized devices" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments