Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-theme-styles

Install

yarn add react-native-theme-styles

Config

Add the following lines into app.js

import {setThemeColors} from 'react-native-theme-styles';
...
setThemeColors({
  dark: {
    background: 'red',
    text: 'blue',
  },
  light: {
    text: 'yellow',
    background: 'green',
  }
});

Usage

// Init styles
const styleDefault = StyleSheet.create({
  container: (_isDark, theme) => ({
    flex: 1,
    backgroundColor: theme.background,
  }),
  btnLogin: {
    marginHorizontal: 0,
    marginVertical: 0,
  }
});

import * as React from 'react';
import {TouchableOpacity} from 'react-native';
import {useStyle} from 'react-native-theme-styles'; // Import here

function ExampleView() {
  const styles = useStyle(styleDefault); // use here
  console.log('>>>styles', styles);
  return <View style={styles.container} />
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages