question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Creating Multiple Variants

See original GitHub issue

I am looking for a way to create multiple variants for buttons. For example, let’s say I want to have the following three variants:

  1. Size (small, medium, large, etc).
  2. Look (primary, secondary, disabled, etc).
  3. Kind (default, outline, text, etc).

So that I could style a button like this:

<button
 sx={{
    size="buttons.size.large"
    kind="buttons.kind.outline"
    look="buttons.look.secondary"
 }}
/>

This IS possible with style system – here is an example:

But I can’t figure out how to do with with Theme-UI.

Is this possible with Theme-UI? If so, can how can I do it?

Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
jxnblkcommented, Jan 16, 2020

We’ve discussed adding support for a variants key which would deep merge multiple variants, but haven’t introduced that yet

4reactions
CanRaucommented, Dec 24, 2019

How about comma separated strings? @jxnblk

Merry Christmas to y’all 🎅 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Design Guidelines for Selling Products with Multiple Variants
Different products should have different listings; product variations should be displayed under a single listing.
Read more >
Adding variants - Shopify Help Center
In the Variants section, click the name of the variant to duplicate, and then click Duplicate. Edit at least one option value to...
Read more >
Create and use variants - Figma Help Center
Create new variants · Click from the toolbar, or · Right-click the main component > Main component > Add variant, or · Click...
Read more >
How Do I Add Multiple Variants on Shopify? - website builder
There are two ways to add multiple variants on Shopify. The first way is to use the built-in Shopify Variant Creator.
Read more >
How can I create Multiple Variants of product with 2 or more ...
I am trying to create 9 variants in a single CREATE API Call, set there stock etc. final product should have following variants....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found