Using theme variables from getTheme and connectStyle
See original GitHub issueQuestion: Is it possble to have a component use the variables that are injected into:
<StyleProvider style={getTheme(material)}>
<App>
</StyleProvider>
As far as I can tell, connectStyle
only allows you to add variables to your theme, it does not allow access to existing ones.
For example if my app looks like so:
<StyleProvider style={getTheme(material)}>
<App>
</StyleProvider>
I want to be able to pull out the brandPrimary
variable from our material injected theme like so:
<App>
<Text style={this.props.style.brandPrimary>
Some Text
</Text>
</App>
export const connectStyle('NativeBase.Theme', {})(App);
Anyone know if this is possible?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Customize
What are themes and variables and how to change them? NativeBase comes with a theme folder which comprises of two sub-folders. components: Theme...
Read more >How to use the native-base.getTheme function in native-base
getTheme examples, based on popular ways it is used in public projects. ... themeName]; const theme = getUserTheme(variables, customVariables); return ...
Read more >javascript - Nativebase - customise a component
I fixed the error by using an empty getTheme() in the <StyleProvider> : const renderCategoryRow = (props, item) => { const styles1 ...
Read more >How to create better themes with CSS variables
CSS variables let you define values for reuse throughout a CSS file , opening the door to more efficient theming capabilities — no ......
Read more >Writing a Theme - Tutorials - Shoutem Developers
Here the app owner can customize your theme through theme variables. ... Also, import connectStyle from @shoutem/theme to connect the component to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is there a solution to this? We followed the guide for a custom component, but now we want those styles to be overwritten by a variables.js file. Any hint or is this just not possible?