Skip to content

Commit fe9e7d5

Browse files
author
Nir Hadassi
committed
shortened ScaledSheet example
1 parent 6850c26 commit fe9e7d5

1 file changed

Lines changed: 4 additions & 21 deletions

File tree

README.md

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,30 +69,13 @@ import { ScaledSheet } from 'react-native-size-matters';
6969

7070
const styles = ScaledSheet.create({
7171
container: {
72-
width: '100@s',
73-
height: '200@vs',
72+
width: '100@s', // = scale(100)
73+
height: '200@vs', // = verticalScale(200)
7474
margin: 5
7575
},
7676
row: {
77-
padding: '10@ms0.3',
78-
height: '50@ms'
79-
}
80-
});
81-
```
82-
is equivalent to:
83-
```js
84-
import { StyleSheet } from 'react-native';
85-
import { scale, verticalScale, moderateScale } from 'react-native-size-matters';
86-
87-
const styles = StyleSheet.create({
88-
container: {
89-
width: scale(100),
90-
height: verticalScale(200),
91-
margin: 5
92-
},
93-
row: {
94-
padding: moderateScale(10, 0.3),
95-
height: moderateScale(50)
77+
padding: '10@ms0.3', // = moderateScale(10, 0.3)
78+
height: '50@ms' // = moderateScale(50)
9679
}
9780
});
9881
```

0 commit comments

Comments
 (0)