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.

Support variant styles

See original GitHub issue

From what I can tell dessert-box doesn’t support variant styles yet, and I think it would be a great addition.

The API I’m looking for is something like

// Button
<Button variant="primary">Call to action</Button>
<Button variant="tertiary">Cancel</Button>

// Text
<Text variant="h1">Lorem ipsum dolor</Text>
<Text variant="h3">Lorem ipsum dolor sit amet</Text>

The variant prop would need to be able to set multiple style properties, e.g. setting variant=primary could change fontSize, backgroundColor etc

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
TheMightyPenguincommented, Sep 16, 2021

@tmm @graup @alexandernanberg so as @vanilla-extract/recipes was released, that does provide a great API for variants when using vanilla extract. So with that in mind the createVariants API was removed, and instead I documented how to use this library with recipes:

https://github.com/TheMightyPenguin/dessert-box#variants

I’ll be documenting more patterns, and common use cases in the README!

3reactions
TheMightyPenguincommented, Aug 5, 2021

Awesome, @graup @tmm thanks for the feedback, expect a new release over the upcoming weekend 🙌

Read more comments on GitHub >

github_iconTop Results From Across the Web

Difference between core styles and variants
Core styles include color, shape and form, typography, and imagery. Variants. Variants are a different version of the theme, usually different ...
Read more >
font-variant - CSS: Cascading Style Sheets - MDN Web Docs
The font-variant CSS shorthand property allows you to set all the font variants for a font.
Read more >
Support product variants - Shopify.dev
Support product variants. Products can be broken up into a maximum of three options, and a single combination of those options is a...
Read more >
How to use the Variants Style add-on - EcomSolid Help Center
In this article, we will take a deep dive into the Variants Style add-on and how it enables you to customize your product...
Read more >
Create and use variants - Figma Help Center
As you create components and build out your design system, you'll find the need for components that are similar to each other, with...
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