-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Theming solution #2
Comments
I think the provide/inject method would probably be the most straightforward unfortunately I'm getting an error when trying to implement it. Do you have any ideas on how I can fix it? Here is the <styled-footer>...</styled-footer> import StyledFooter from '../styles/StyledFooter'
export default {
name: 'BlueFooter',
provide: { theme: 'blue' },
components: { StyledFooter },
} Here is the import { styled } from 'styletron-vue'
import { colors } from '../data'
export default styled('footer', (props, { injections }) => ({
color: injections.theme === 'blue' ? colors.blue : colors.gray
})) The error is:
|
@ianwalter hmm you need to bind maybe we should allow to pass that in |
Ah you're right, I added it to the App's root Vue instance but I'm seeing the error in Storybook.js which most likely creates it's own root instance. I'll have to figure out a way to pass it to that, thanks! |
@ianwalter basically you can set |
In the meanwhile I made https://github.com/egoist/emotion-vue which you don't need to bind the instance but you need the |
@egoist Thank you, I've gotten both working. Emotion doesn't seem to provide the same optimization as styletron on the other hand styletron doesnt support nesting and is hard to debug strangely enough since it doesn't show the css in the |
Currently it supports:
Not sure which one is the best though 😅
The text was updated successfully, but these errors were encountered: