Making Stylesheets in Sketch
Client: Make it all blue. *three weeks later* No, not THAT blue!
If I had a nickel for every time I’ve had to update colors across an entire design, I’d probably have like…well…maybe only one or two, because I’m great with color. Here’s a photo someone captured of me designing an interface for Apple:
But for real, it happens all the time, and the reason is always different:
• “Ah sorry, we changed the branding.” 😕
• “Shoot, we gave you an old style guide.” 😑
• *radio silence* 🙄
• “Can you make that color POP some more?” 🙃
• “Here’s a photo of our logo. Just ‘Photoshop’ the color from there.” 🤔
• “We need to match the Pantone color of our mousepads.” 😐
• “My (significant other) doesn’t like the color.” 😫
And the fact of the matter is, whether this happens or not, it’s best practice to build your design documents so that they’re scalable and maintainable. A request to update the brand color should be as easy as a Bob Ross painting lesson is serene.
Here are some tips for creating a stylesheet in Sketch where you can centrally maintain visual details like fonts and colors.
Let’s call this the “pancake method” because I’m currently on the Whole30 Diet and all I can think about is pancakes. (help, I’m starving)
Step 1 to this whole process is creating saved styles for text and color. It’s pretty easy, but can be a bit tedious. Hang in there:
Do this for all colors you plan on having in your product. If you add more down the road, just make sure you create styles for those, too. Here’s my color sheet:
Pretty easy, huh? But here’s what you don’t see:
For each color in my palette, I’ve actually created 6 layer styles that I anticipate needing in various places throughout my design. Each of the six rectangles you see above represent a different layer style that I’ve saved.
For a nice clean look (and to save space), I make identically-sized rectangles with a different style assigned to each, then stack them perfectly on top of each other. If I ever need to update the color, I just highlight the whole block (which selects all six layers), make my changes, and sync!
Sketch will show you all of the settings for each rectangle, but when you sync your changes, each layer style will be updated individually without overwriting the others. It’s pretty handy:
This works for text, too! Here’s what my text stylesheet looks like:
Note to Sketch: I feel like I shouldn’t need unique text styles for a bunch of different colors. Maybe we come up with a way to define the base text, then have a way to apply color on top? Food for thought!
So where do the pancakes, errr, stacking come in? I find that for black and white text, it’s handy to have three levels of transparency. So what looks like a column of text styles for black, is actually a stack of three text styles at each transparency level:
Again, I just stack these on top of each other (Align→Left) which makes it’s easy to update them all later. As with the layer styles above, Sketch will preserve the unique styles for each text style you highlight, so any changes you make and sync will apply to each text style individually. So don’t worry about highlighting everything, changing the color, and Sketch overwriting all of your text styles to 14px bold. It won’t happen.
2. Label Locking
For the love of Dieter Rams, label everything on your stylesheet. For layer styles, just slap some text on top of it describing what it is. For extra bonus points, show how it might be used:
Once you’ve labeled everything, select anything that isn’t something you want to update, group them into a “Labels” folder, then lock it like it’s hot. This way you’ll never accidentally select your labels when you’re trying to update one of the styles.
Watch how when I drag to select that it only selects the objects that I should be updating, not the labels around it:
3. Self Reference
You have all these nice styles now, so why not use them?
I designed my style guide using all of the layer and text styles I defined on my stylesheet. If I ever update the font or colors, not only will those styles update throughout my design, but my style guide will, too. Fonts, colors, everything.
It’s a dumb trick, but if you’re tasked with updating the product and style guide to match some newfangled branding from marketing (love you guys), you’ll save yourself a lot of headache if you don’t try to get overly fancy with the style guide and just design it using the styles you already have. Heck, use your text styles for things like annotations, too! Then if you update the font, even your spec will match. It’s the little things. 😍
A finally, speaking of specs…
4. Share it!
Your stylesheet will quickly become one of your developer’s favorite assets. Share it! I use Inspect by InVision to sync my stylesheet directly out of Sketch and into the hands of the development team. For design discussions, I also love Marvel for their project pages.
Even if I haven’t finished my designs, allowing developers to get a head start on CSS classes is a huge help. In my experience, I haven’t had a single developer who didn’t love this type of handoff.
If you don’t use InVision, Zeplin is another fantastic tool for doing the same thing. Zeplin is a wonderful product, but I just personally like keeping all of my assets in one place on InVision.