[fix] StyleSheet: shorthand properties

Expand shorthand properties to preserve the one-rule-to-one-style
isolation. Resolve styles like React Native - most specific comes last.
Add support for the hz and vt properties for margin and padding.

Fix #40
This commit is contained in:
Nicolas Gallagher
2015-12-13 12:06:46 -08:00
parent e1da11fa1d
commit 501c19fe9b
10 changed files with 126 additions and 15 deletions

View File

@@ -213,7 +213,8 @@ export default class App extends React.Component {
const styles = StyleSheet.create({
root: {
common: {
margin: '0 auto'
marginVertical: 0,
marginHorizontal: 'auto'
},
mqSmall: {
maxWidth: '400px'
@@ -230,7 +231,7 @@ const styles = StyleSheet.create({
alignItems: 'center',
flexGrow: 1,
justifyContent: 'center',
borderWidth: '1px'
borderWidth: 1
},
horizontalBox: {
width: '50px'

View File

@@ -4,7 +4,7 @@ const styles = StyleSheet.create({
root: {
alignItems: 'center',
borderWidth: 1,
margin: '10px 0',
marginVertical: 10,
padding: 10,
textAlign: 'center'
},