Sketch Tutorials

This is, without a doubt, the coolest Sketch technique you’ll see all day.

Warning: More GIFs than the peanut butter aisle.

Jon Moore
UX Power Tools

--

Yes, I pronounce it “Jiff”. Go away.

When Sketch launched resizing rules in Sketch 39, it was such a game changer that I wanted to bake a cake with the Sketch logo on it just so I could present it back to myself.

So it goes without saying that when symbol overrides came around in Sketch 41, they had me yodeling out of pure jubilation and ecstasy. It was a pretty big deal.

After much trial-and-error, I’ve created some of the most flexible, customizable, and maintainable components ever using nested symbols, overrides, and what I’m dubbing Cascading Symbol Styles…aka CSS.

Here’s what we can do with cascading symbol styles in Sketch. Can I get an amen? 🙌🏻

To be frank, this technique isn’t particularly novel. It’s just a set of nested symbols, painstakingly organized to appear more organized in Sketch’s Inspector panel. But I thought you all might find it interesting anyway, so buckle up and grab some popcorn 🍿

Let’s dive in to this symbol:

It’s a list item that I’m using in a chat panel. I want to have their photo and name, plus a badge for new messages, and an indicator for whether or not they’re typing (these are stacked so I can turn them on/off depending on which one I need).

The Layers:

Photo

This is a renamed reference of the “Avatar Image” symbol. Why is it renamed? Because this is what shows up in the Inspector panel when I use this symbol elsewhere. I’d much rather that name be nice and clean instead of something like “Avatar/Image” which just ends up getting truncated anyway. No bueno.

Secondly, to cover the use case where a user hasn’t set a profile photo, I created a default avatar that I want to show instead.

Now pay attention, because this next point is important: Because the sizes of the Avatar/Image and Avatar/Default symbols are the exact same (see above), I will be able to choose which symbol I want to show in the Inspector dropdown:

Notice that I’m not bothered by hundreds of my other symbols. That’s because those other symbols don’t match the dimensions of the base symbol nested inside of the list item symbol. Make sense?

Name

The name layer is somewhat counterintuitive, but incredibly powerful. I created symbols of all of my text styles in Sketch so that I could swap colors inside of symbols. It took a while:

But now that I have these, it makes it easy to change the color of the text in my symbol without having to create an entirely new symbol instance:

Since the text symbol is…well…text…that’s why it gives me the option to edit the content. I’ve just gotten fancy and named the actual text layer in that symbol to “↳🖊Content” so that I know it’s changing that content.

Again, this is all a single symbol, so if I edit the base symbol, all of these instances will still update:

One symbol. Three derivations!

Simply magical.

Badge

The badge is yet another symbol, but this one also has some interesting properties. Let’s have a look:

Inside of the badge symbol, I have my text symbol (so I can swap that out later), and a “Container” symbol. Here’s what that looks like:

The “Container” layer in the badge symbol is just a renamed reference to the Rounded container symbol above. Each of these containers has a state symbol (so I can override the state of the badge)…

…a color symbol (so I can override the color)…

…and a mask that determines its shape.

Side note to Sketch: It would be rad if we could use symbols as masks.

Notice that my state symbols and color symbols are different widths. This is to “protect” their dropdowns in the Inspector panel when I’m customizing my list item symbol later. If I’m picking a color for the background, I don’t want to see other symbols in that list. I just want colors.

Just colors! Nothing else!
Just states! Nothing else!

Keep all symbols a consistent size that you want to appear in a dropdown together, and make sure that anything else is at least 1px bigger or smaller. That way they won’t ever show up together 🤓

Typing

This is just a small symbol that shows when someone is typing.

ProTip™: Set all icons as masks and use a color symbol on top of it. That way you can just override the color symbol if you want to change the color. One icon symbol…any color you want 😍

This technique was first introduced by Free&Willing:

Container

Last layer! This one is just a renamed instance of a “Mixin/Fill” color symbol. I added this so I can easily toggle a selected state on and off:

On the far right, you’ll see the “Mixin/Fill/White-Disabled” symbol chosen.

So that’s it! As you can see, these can get pretty sophisticated and require some thought and organization to get right, but the fact that we can now apply literally thousands of different treatments to a single symbol is pretty innovative. It’s singlehandedly the biggest time-saver I’ve ever created.

Pretty cool, huh? I’ve done this with dozens of other symbols, too:

Look at all those cascading symbols in the Inspector panel!

That’s a lot of work for just one symbol, and app designs have dozens, if not hundreds of them.

I went ahead and did all of that dirty for you, and made it look nice:

If you’re interested, you can get them for yourself over at the brand new UX Power Tools site. You can also check out the entire style guide on InVision or Marvel.

I think you’ll like them 🤗

When I’m not goofing off on Medium, I’m working on Sketch tools at UX Power Tools to make you a better, faster and stronger designer. Follow us on Twitter @uxpowertools. Follow me too if you were entertained!

--

--