mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-03-29 09:08:32 +08:00
[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:
@@ -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'
|
||||
|
||||
@@ -4,7 +4,7 @@ const styles = StyleSheet.create({
|
||||
root: {
|
||||
alignItems: 'center',
|
||||
borderWidth: 1,
|
||||
margin: '10px 0',
|
||||
marginVertical: 10,
|
||||
padding: 10,
|
||||
textAlign: 'center'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user