Sketch Tutorials

How to Automate Creating Text Styles and Layer Styles in Sketch

Alternate Title: How to Reclaim 87 Hours of Your Life

Note from Jon: There’s a free download at the bottom of this article!

When Sketch 52 came out, they introduced the ability to override symbols using text styles and layer styles instead of having to create those awful color/text symbols. Remember those? Ew.

While this was a massive win for folks like me who were already SUPER fussy about creating and maintaining text styles, the complaining had already begun on Designer News and Twitter about the need to create text styles.

I, for one, welcome the change with open arms and a basket of baked goods, but I understand that it’s a bit of a tedious task to create text styles.

Fear not, designer dudes and dudettes, I’ve come for your deliverance.

In this tutorial, I’ll show you how I automate creating hundreds of text and layers styles so I can use them when I create my symbols in Sketch.



What We’re Making

There are 972 named text styles in the grid below. We’re gonna make those 😀


Step 1

Set up your base typography sizes. After doing this same thing for 3 years, I’ve found that I never need more than 9 sizes (and I rarely use the largest ones).

Step 2

Name your layers. This is VITALLY IMPORTANT because our Style Generator plugin will use the layer names to generate styles.

In order to take advantage of Sketch’s “foldering” system for saved styles, I like to use the following naming hierarchy:

00 SIZE/COLOR/TRANSPARENCY — ALIGNMENT

  • 00: This will keep my text styles in order of increasing size in the saved styles menu (see below)
  • SIZE: This is the name of my text style. Unless you want them to, they’re not intended to map to actual HTML tags. I find it’s much easier to remember text styles and their relative sizes if they have names (instead of H1, H2, H3, etc…)
  • COLOR: This is the color of the text style. Except for Black and White, I recommend using generic names for your colors (Primary, Secondary, Accent 1, Accent 2, etc…) because you might end up changing that color down the road. It’d suck to be stuck with 104 “red” styles when the actual color is blue.
  • TRANSPARENCY: I’ve talked about this before, so go check out #3 in this article for more information. Basically this is the lightness level of this particular color.
  • ALIGNMENT: Left, Center, Right. This is how your text is aligned.

Once you have your five to ten base text layers named according to the structure above, you’re ready to move to Step 3.

Step 3

Highlight all of your text layers and duplicate them. While the new duplicates are still selected, run your Find & Replace plugin and replace the alignment:

Don’t forget to actually CHANGE THE ALIGNMENT of these layers. I tend to forget that step.

Rinse and repeat for all alignments (Left, Center, Right).

Step 4

Now we’re going to work on TRANSPARENCY. I like to create three levels: Default, Light, and Lighter.

I use these names intentionally because Sketch alphabetizes your layer styles. Feel free to come up with your own names, but I recommend keeping them in transparency order in that styles menu, so name them accordingly:

Again, don’t forget to actually change the transparency.

Rinse and repeat for all opacity levels (Default, Light, Lighter). I usually do 100%, 50%, and 25%.

Step 5

Duplicate the three sets that you just created for as many colors as you need. Use the Find & Replace plugin to change the color name:

Step 6

Once you’ve done this for all of the colors you want, you’re ready to run the Style Generator plugin!

Highlight ALLLLLLL of the text layers you just created, then choose “Generate Shared Styles” to create styles!

WARNING: It might take a minute or two…you’re generating several hundred text styles all at once, so give it time to do it’s thing. Go get a cup of coffee or bug your coworkers.

When you’re done, you should have a BEAUTIFUL list of saved styles, all ready for you to start using in your designs and symbols:

Step 7

At this point you’re finished, but I wanna add that you’ve actually just created a beautiful style guide that will allow you to make bulk changes to your saved text styles SUPER EASILY.

Just highlight all of the text layers in one of the color rows, change the color, and sync your changes:

Sketch is smart enough to preserve all of the individual attributes of each unique text style, so when you update the color, it’ll leave the alignment and transparency alone. I love you, Sketch.


That’s it!

You just generated several hundred text styles in about 5 minutes. You can use this same method for generating layer styles for things like colors and borders:

Because I love you all, I’m going to give you one of my text style sheets. This file has 972 text styles in all kinds fo different colors, alignments, and transparency levels. You’re welcome!

I use this exact method in a design system starter kit I created called UX Power Tools (click to learn more).

There are hundreds of text styles and layer styles already created that I used in every single symbol. This allows you to override text styles and colors until your heart is content. You can grab that here: