vitalets / react-native-extended-stylesheet

Extended StyleSheets for React Native
MIT License
2.93k stars 132 forks source link

add composition from 'cssModules' #23

Closed pvpshoot closed 8 years ago

pvpshoot commented 8 years ago

How about to add Composition? something like that:

const styles = EStyleSheet.create({
  icon: {
    color: '$dark',
    fontSize: '1.4rem',
  },
  icon__succes: {
    composes: 'icon',
    fontSize: '1rem',
  },
});

https://github.com/css-modules/css-modules#composition

brunolemos commented 8 years ago

@pvpshoot why not just use the power of js? something like this:

const icon = {
  color: '$dark',
  fontSize: '1.4rem',
};

const styles = EStyleSheet.create({
  icon,
  icon__success: {
    ...icon,
    fontSize: '1rem',
  },
});
vitalets commented 8 years ago

Agree with @brunolemos ! I'll try to keep this lib as simple as possible.

@pvpshoot did it worked for you?

pvpshoot commented 8 years ago

@vitalets yes, its work fine