Last active
November 23, 2017 16:39
-
-
Save cball/65a50634d2da90260cb7cf02b08f443a to your computer and use it in GitHub Desktop.
Example of app-wide fullScreen style and StyleSheet's built-in absoluteFillObject that does the same thing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App/Theme/ApplicationStyles.js | |
export default { | |
fullScreen: { | |
position: 'absolute', | |
top: 0, | |
bottom: 0, | |
left: 0, | |
right: 0 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App/Theme/ApplicationStyles.js | |
export default { | |
red: '#BD3760', | |
reallyFadedWhite: 'rgba(255, 255, 255, 0.3)', | |
transparent: 'rgba(0,0,0,0)' | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App/Theme/index.js | |
import ApplicationStyles from './ApplicationStyles'; | |
import Colors from './Colors'; | |
export default { | |
ApplicationStyles, | |
Colors | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App/Components/SomeComponent/styles.js | |
import { StyleSheet } from 'react-native'; | |
import { ApplicationStyles, Colors } from '../../Theme'; | |
export default StyleSheet.create({ | |
container: { | |
// ...ApplicationStyles.fullScreen, | |
...StyleSheet.absoluteFillObject, | |
backgroundColor: Colors.red | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment