Skip to content
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

Is this possible? RedComponent = Component.classtext-ted #8

Open
koresar opened this issue Jan 29, 2019 · 0 comments
Open

Is this possible? RedComponent = Component.classtext-ted #8

koresar opened this issue Jan 29, 2019 · 0 comments

Comments

@koresar
Copy link

koresar commented Jan 29, 2019

Hello people.

I have, say, a blue button. In 10 places of my app the button should be red. Here is what I'm doing atm:

<template>
<Button class="text-white bg-red hover:text-orange shadow-red"/>
</template>

I'm looking to avoid writing this class="text-white bg-red hover:text-orange shadow-red" 10 times. I'd rather have something like:

export default const RedButton = Button.class`text-white bg-red hover:text-orange shadow-red`;

And then just reuse it everywhere:

<template>
<RedButton/>
</template>

The above approach is the syntax I really like in React's Styled-Components.

Is it possible with (or without?) styled-vue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant