Text Styles Mastery with Sketch 52

Use text styles to create an effective type system compatible with components overrides.

Hi, you might have noticed new changes in our favourite application, text styles are now available for overrides. Hooray! This means that now we can create a single set of styles to handle both plaintexts and components.

This update drastically improves the technique from the previous article by adding an extra layer of customization to the overrides. I would like to introduce you an updated method on creating a universal set of Text Styles, which you would love to use for every next project.

This tutorial is brought to you by Buninux.com, check out the best Sketch UI kits aka Design Systems. 👀

Creating the primary set of styles

We start by picking up proper names for the styles we plan to design with. This time we will use a more sophisticated naming to fit for both web and mobile typography patterns.

We will be using Hero, Title, Subtitle and Paragraph styles for plain-texts and any type design. And a separate set of styles for our components, such as Button 1, Button 2, Input 1 and Input 2, where 1 or 2 is the definition of the font size predefined for certain component. (Just like <H1> or <H6>).

You a free to change the rules by adding your own names, just remember that a naming convention should clear convey a certain style value or meaning, without unnecessary prefixes.

1. Let’s begin with a new document and write down all the styles in one list to form an icicle.

IBM Plex Sans. https://fonts.google.com/specimen/IBM+Plex+Sans

2. Duplicate the column 2 times to form a table with a left and right text alignments. Select all component styles with a key, and set their vertical alignment to the center of a fixed text layer.

Hint: If you can’t change the vertical alignment, increase selected layers height by 1 digit and then drop it by 1.

⚠️ Setting the vertical alignment will help you to better manipulate symbol overrides and match different component states. We will cover the results of this trick ahead.

3. Duplicate the table/artboard with your list a desired number of times to create different colors for your type system.

You can use pre-made colors to describe interface states, highlight or obscure any text line you want, and express brand through a consistent use of colors and fonts. 🤓

4. Now again to the naming part, we will use layer names to generate styles and set up the text menu structure using Rename It plugin. To do so, we first need to come up with certain name rules for our layers, I suggest to use the following formula:

%* / Alignment / Color
Where %* is the current layer name.

First use Rename It plugin to apply the naming tags to each table column. After then use Styles Generator to create text styles from resulted layer names.

Hint: Use shortcut ⌃⌘R to call up the Rename It menu, and ⌃⌘S to generate styles with Styles Generator.

Pro hint 1: You can add naming tags to manage styles, and group them into menu categories, for example, you can add the Button / or Input / tags before the alignment to create a component based category that will be more easily accessed via overrides menu, for example:

%* / Category / Alignment / Color
Where Category is the type of the component.

Pro hint 2: If the menu structure behaves unpredictably, or the same styles got into different subcategories. It’s possible that the reason, is that you have missed some spaces between the tags and “/” slash symbols.

To fix it, select all text layers and run the Find and Replace Names command via Rename it plugin. For first input leave a single spacebar tap and the second one leave blank.

This will do the trick and eliminate unnecessary gaps between tags and sort all names properly, like this 👇.

Pro hint 3: You can add “_” glyph to the start of the naming tag to prioritise a certain style/group to stay on top of the menu list.

And it’s done! All styles are ready and easily accessible! Meh.

Text styles and symbol overrides

In Sketch 52 each text layer placed into a symbol with a style applied will be available for the override. And using our convention we can freely manipulate any properties such as Horizontal, Vertical alignment, Color, and Size, allowing for us to build better, more flexible components just with the help of correct layer positioning and following tricks:

1. Create a new symbol and place the text layer relative to the grid (You can use a classic 8pt grid approach). Just take into account the indents from all sides including top / bottom borders, and pin the text layer resizing to the edges of your container.

Nested text layer resizing constraints.

2. Use override to change component proportions and create multiple component States / Types, while your text labels will always stay right in the middle of your component.

Hint: By adding an icon to the right side you can handle more button/input variations.

3. Whenever you need to create a component with a different vertical alignments, such can be Toast’s or Text Areas, you can switch to a Paragraph or equal style which will fit the desired behavior.

Making the full use of predefined top / bottom boundaries, and the vertical alignment trick. 👆

To summarise and commit the experience, I prepared a small bundle containing 2 different Text Style Templates with JSON’s files available for quick import/export using an awesome Shared Text Styles plugin.

Single Font Template Contains text styles to work with one font per document, featuring following tag categories: Type, Alignment, Color.

Duo Font Template — Contains text styles to work with 2 and more different fonts, featuring following tag categories: Font family, Alignment, Color. (The <H1> to <H6> method described in the previous article).

Feel free to download and use it for future projects. 😉

👉 Download Text Styles Bundle

Original shot: https://dribbble.com/shots/5461577-Text-Styles-Bundle-for-Sketch

Share or like this post if you find the method being useful, and go visit Buninux.com to download the best Sketch app UI kits. 👇

You’ll support my further work by purchasing one of the tools I lovemaking and keeping up to date with the all latest features. 🙏

Before you leave:

  • For more news and updates follow me on Twitter and Dribbble.
  • Discover more about the latest Sketch 52 update, by downloading more freebie files to preview both Frames and Plaster design systems. 👇