-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set global styles? #52
Comments
I'm not sure what you're asking - the intention is to have no global styles. |
@ljharb OK, if you want to have body (font, bg) linked to the theme, how do you do that if body is outside your react app? |
You supply the theme from the same data source that you use to set body attributes, I suppose. |
what if you want to switch themes on the go? then you need to have at least 2 solutions to solve 1 problem |
Is your entire app not in react, such that the body needs any styling? If so, then you may indeed need to write a lot of code to mesh together two very different rendering patterns. |
my, app is in react, but it is isomorphic and I'd love to set some body defaults. This library is in fact the most close to what I need, but it would be nice to have globals just like they do in Aphrodite: const styles2 = StyleSheet.create({
globals: {
'*div': {
color: 'blue',
},
},
}); I will probably use this approach, but I'm curious if it can be done naturally without hacking |
I think this would be up to the specifics of the underlying interface you are using. If you are using the aphrodite interface, this might just work for you out of the box. However, I'd suggest trying to avoid relying on interface-specific behavior, because it will make it more difficult to switch between interfaces if you want to later. Instead I wonder if it would work for you to create a component that does what you want, that you would render at the top level of your app. Something like |
@lencioni In Aphrodite they extend stylesheet
But can I do same to |
Hi. How I can declare reusable styles, for example, "clearfix" and use it in many components? |
Hi.
Dependency injection (import, require).
…On Mon, 28 Aug 2017 at 15:30, Vladislav Kosovskikh ***@***.***> wrote:
Hi. How I can declare reusable styles, for example, "clearfix" and use it
in many components?
|
I have found a way to add extensions to
|
Is it possible to have something similar to aphrodite global extention:
https://github.com/Khan/aphrodite#creating-extensions
The text was updated successfully, but these errors were encountered: