1

Is there a way to make a variant of a shared style in SketchApp?

I have a view with 4 'pricing' cards, which I want to share properties across like gradient, drop shadow, etc. etc. etc.

But I want them to have different background colours, and maybe other small differences.

Obviously I could just manually match the styles without a 'shared style' library, but, out of academic curiosity, is it possible to make derivative variants?

Or maybe just a 'shared single property' instead of a 'shared style' group?

2

You can do that using nested symbols.

The idea is creating a main symbol (N) that contains others symbols (N-1). Then, you can define variants for each sub-symbol (N-1). For example, in your pricing symbol, if you want your background being switchable, it has to be a symbol itself.

  1. Create your main symbol

    enter image description here

  2. Convert each element you want to be switchable to symbols (here are the sub-symbols)

    enter image description here

  3. Duplicate each sub-symbol and apply your variants. Important : each type of symbol must be the same size EX : title gray size = title blue size = title green size. This way, Sketch can detect them as variants.

    enter image description here

  4. Now you can go back to your artboard and import the main symbol. In the right panel, you'll se dropdowns and input. There are the symbol overrides where are listed all the variants. http://jmp.sh/d0Fi3Yd .

    enter image description here

Hope that helps !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.