vitalets / react-native-extended-stylesheet

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

Get value in other theme #61

Closed ArmandoAssuncao closed 6 years ago

ArmandoAssuncao commented 7 years ago

Hi, i have define a lightTheme how default, how could i get a value of the another theme? something like:

import lightTheme from './lightTheme'
import darkTheme from './darkTheme'

EStyleSheet.build(lightTheme) // set light theme

const font = EStyleSheet.value('$font', darkTheme) // get value of dark theme

is there any way to do this?

thanks :-)

vitalets commented 7 years ago

Hi! Could you describe more why you need this?

vitalets commented 6 years ago

Theme is just and object so you can directly get value from it:

import darkTheme from './darkTheme';

const font = darkTheme.$font;