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

Extending styles of multiple variants to form another variant #1208

Open
a-y-u-s-h opened this issue Oct 10, 2020 · 2 comments
Open

Extending styles of multiple variants to form another variant #1208

a-y-u-s-h opened this issue Oct 10, 2020 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@a-y-u-s-h
Copy link

Is your feature request related to a problem? Please describe.
Currently the variant prop accepts a string and allows creating variants by extending a single variant. It's not really a problem, but doing so results in bigger theme files compared to a scenario where the variant key could take an array or a string, and then merge all their styles in order to create resulting variant.

Describe the solution you'd like
variant key should be able to accept a string or an array of variants, and then if it's a string - it behaves like how it behaves right now but if it's an array: it should merge the styles of those variants in order that they're mentioned in - sort of like how we extend styles in SCSS. This will result in less number of variants and more crazy combinations.

Describe alternatives you've considered
SCSS does this properly, but I just use Theme UI and then just extend one variant and copy styles from the variants that I want to extend.

@dreamyguy
Copy link

dreamyguy commented Oct 16, 2020

It would be great if variant could accept/be an array. Right now, if I want to merge two variants I have to create another variant, duplicating the styles. But the values are already defined, and the composition principle "breaks".

If I understood it right, I think it would solve #1209 as well.

@atanasster
Copy link
Collaborator

  • @hasparus
    I would really appreciate some help checking the PR, as I am only getting familiar with the code base and tools/tests and into which branch to merge.

@lachlanjc lachlanjc added the enhancement New feature or request label Dec 3, 2020
@lachlanjc lachlanjc linked a pull request Dec 3, 2020 that will close this issue
@lachlanjc lachlanjc mentioned this issue Jan 17, 2022
16 tasks
@lachlanjc lachlanjc added this to the v1.0 milestone Jan 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants