Skip to main content
Solved

How to make changes apply across variants

  • February 2, 2021
  • 3 replies
  • 7222 views

Evan_MacAlpine

I’ve made a number of variants of a card, but now I’d like to change the line-height of a heading across variants. Is the only way to do this by selecting all of the headings manual? Or is there away to apply changes to one component (the parent?) and have them apply across all the variants?

Best answer by Alex

I’d suggest using styles for this — change it once and it updates everywhere.

View original

3 replies

Gleb
  • Power Member
  • 4706 replies
  • February 2, 2021

The only solution would be to use a something like base component for all these variants. Then place an instance of that component in every variant and style them like you want. You will be able to change the layout and add/remove elements in the base component.


Alex
  • New Participant
  • 16 replies
  • Answer
  • February 2, 2021

I’d suggest using styles for this — change it once and it updates everywhere.


Evan_MacAlpine

Ahh. True. That’s a good point. I hadn’t extracted the text styles yet. I was waiting till I had all the variants nailed. But in hindsight it makes sense to extract the styles once the default component is finished. Thanks for the insight!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings