I’m trying to use the variables feature to reduce maintenance on some of our bigger library components. A good example is the button component, which currently has definitions for different colors/states/styles built in.
The problem is that this is a LOT of variants to maintain. If I could use variables to set size and color, life would be much easier. But I’m stuck on how to actually do that. My current best guess is something like:
- Create a collection that defines all the color variables for each component
- Create each color as a different “mode” within that collection
- Use the mode swap to control the color of the button in-context
But I’m not sure that’s the right answer, and without the ability to move variables between collections I’m hesitant to put a lot of setup work into something that may not achieve what I’m trying to do. Does anyone have any thoughts on how I could get this working with variables?