Component library for multiple brand colors

How would you architect a component library for multiple brands? The only difference would be the color palette. Would it make sense to provide all the components at the core, with the color removed, then at the child/brand level, wrap it in a new component and add the color. I think this would this provide updates to things like size and font, but the color would remain autonomous.

Exactly like this. One component library without colors, then several color libraries. By default, one would have to be applied to the main component library, but the switch can be made using “Swap libraries”.

If your users need to have multiple brands in one file, this solution doesn’t work, though.

I wasn’t aware of the swap libraries but it looks like a winner. Thanks

So, the swap takes place after the design. I think optimally, you would set one base component library, then overlay a theme from the beginning.

in order to achieve that you would need to have a duplication of the core component library for each brand.

Yeah, I can’t seem to find another way than that. Thanks