Skip to content

dubbelnisse/react-native-multiple-styles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-multiple-styles

A simple utility for handeling mutiple styles (classes) in react-native

Install with npm.

npm install react-native-multiple-styles --save

Import it to your project

import multipleStyles from 'react-native-multiple-styles'

Usage

var styles = StyleSheet.create({
  icon: {
    backgroundColor: 'black'
  },
  iconRed: {
    backgroundColor: 'red'
  }
});

multipleStyles(styles.icon, styles.iconRed) // => [1, 2]
multipleStyles(styles.icon, { [styles.iconRed]: true }) // => [1, 2]
multipleStyles(styles.icon, { [styles.iconRed]: false }) // => [1]

It returns an array of the IDs representing the style objects. More info about that here.

Tests

npm test

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published