Babel Plugin for ReactNative CSS Shorthand
This plugin will let you define margin
& padding
within React Native StyleSheet
similar to CSS shorthands.
Example
Input
; const styles = StyleSheet; ;
Output
; const styles = StyleSheet; ;
Installation
$ npm install --save-dev babel-preset-react-native babel-plugin-react-native-css-shorthand
Then, create a .babelrc
in your project root with the following content:
TODO
- Add
test
- Add
borderWidth
support