File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,13 +8,16 @@ const input = {
88 height : '50@vs' ,
99 margin : {
1010 width : 12 ,
11- height : '12@s'
11+ height : '12@s' ,
12+ paddingBottom : - 1
1213 }
1314 } ,
1415 row : {
1516 padding : '10@ms0.3' ,
1617 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' ,
1821 }
1922} ;
2023
@@ -24,13 +27,16 @@ const expectedOutput = {
2427 height : verticalScale ( 50 ) ,
2528 margin : {
2629 width : 12 ,
27- height : scale ( 12 )
30+ height : scale ( 12 ) ,
31+ paddingBottom : - 1
2832 }
2933 } ,
3034 row : {
3135 padding : moderateScale ( 10 , 0.3 ) ,
3236 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 ) ,
3440 }
3541} ;
3642
Original file line number Diff line number Diff line change @@ -2,10 +2,10 @@ import { StyleSheet } from 'react-native';
22import { moderateScale , scale , verticalScale } from './scalingUtils' ;
33import deepMap from './deepMap' ;
44
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 } ) ? ) ? $ / ;
99
1010const scaleByAnnotation = ( value ) => {
1111 if ( ! validScaleSheetRegex . test ( value ) ) {
Original file line number Diff line number Diff line change 11{
22 "name" : " react-native-size-matters" ,
3- "version" : " 0.1.2 " ,
3+ "version" : " 0.1.3 " ,
44 "description" : " A React-Native utility belt for scaling the size your apps UI across different sized devices" ,
55 "main" : " index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments