thabti / react-native-css

Style React-Native components with css
MIT License
769 stars 66 forks source link

Convert px to numbers fails when overriding previous property #26

Closed alexmick closed 8 years ago

alexmick commented 8 years ago

This css

.row {
  padding: 10px;
  padding-left: 5px;
  flex-direction: row;
  margin-bottom: 2px;
}

will compile to

row: {
  paddingTop: 10,
  paddingBottom: 10,
  paddingRight: 10,
  paddingLeft: "5px",
  flexDirection: row,
  marginBottom: "2px",
}

which is not valid for a React Native Stylesheet.

I believe this is because the padding-left overrides the padding just above and that isn't properly managed.

I've forked the repo, written a regression test and will try to submit a PR with a fix.

thabti commented 8 years ago

merged, thank you for contributing.