narendrashetty / react-native-styles-shorthand

Easy to use CSS shorthand properties in React-Native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Suggestion/Collaboration

jamielob opened this issue · comments

Hey @narendrashetty. I was just about to create something very similar to what you've started here.

The API would be:

import StyleSheet from 'react-native-styles-shorthand';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    margin: '10 20 30 40'
  },
  welcome: {
    padding: '10 20',
    margin: '100',
  }
});

That means that in order to switch over to using this package, all you would need to do if change where you're importing StyleSheet from.

@jamielob Good point! Totally makes sense. I'll try and implement it in the next release. Thank you.