Merge duplicate styles in Sketch

Oscar Oto
Oscar Oto
May 21, 2019 · 4 min read

You have duplicate, inconsistent, and unnecessary layer styles and text styles in your design, and you know it 😊.

Even if you are the tidiest designer in the face of Earth there are several situations that may introduce duplicate and inconsistent styles to your design file. The most common are:

  • You start a design based on a previous project, and all old styles are still there.
  • You copied styled texts or shapes from other design files (and their styles got imported too).
  • You started working on a design, creating styles, …, and some time later you realized that you should use a Sketch Library to host styles and branding stuff. And… ouch, styles are now defined in both places.

Sketch allows you to have different layer and text styles with the same name, and there’s no way to overwrite one with another.

You know what comes next. “Inconsistency” is a polite way to call it. It’s a style mess. It’s hard to manage. Hard to use. Hard to teach. Hard to prevent collaborators (or even yourself) for creating new redundant styles. It’s even hard to know which of those equally named or visually similar style you need to apply to your supercool new card component.

When importing work from anywhere else, there’s a high probability of getting duplicated styles in your own file.

But the real problem is that, after all, some of your layers and texts will be referencing the “good” style, and some others the “bad” one that look almost the same, what makes it really hard to even to notice the difference.

Some layers will be referencing the first style, and some will be referencing the second one. Boom -> Maintainability nightmare :)

It’s a really similar problem to having duplicate symbols in your files. So we decided to enhance the Merge Duplicate Symbols plugin to also fix it :)

Merge duplicates

The Merge duplicates plugin was built to merge duplicate symbols. Now it also enables you to automatically find all the name-duplicated text or layer styles within your whole Sketch file (even if those styles are coming from External Libraries) and prompt you about what to do with them.

Merging inconsistent text styles

Just run the plugin, choose the styles you want to keep, and press Merge. The style you decided to keep will be applied to all layers (and overrides) using the discarded styles, and the discarded styles will be removed (*).

(*) External libraries styles won’t get removed from their libraries.

Merge styles with same name vs. Merge styles from list

The plugin has two “flavours”:

  • Merge styles with the same name will automatically scan your document for styles with the same exact name, and prompt you about what to do with those. You’ll get prompted for each duplicated style it finds, the same way the “Merge duplicate symbols” plugin works.
Merging duplicate text styles
  • Merge styles (from list) will let you select which styles you want to merge (from the whole list of styles within the document and external libraries), and merge them, even if they have different names.
Merging several text styles all at once

The plugin

Merge Duplicates is available for purchase on Gumroad.

Get Merge Duplicates on Gumroad

Works best with…

If Merge Duplicates is useful for you, this plugins will definitely boost your productivity:

Sketch Styler assigns styles automatically to all of your unstyled layers. It will scan your Sketch files for unstyled texts and look which of the existing styles (in the file or in linked libraries) match best for them.

Sketch Manager makes it so easy to keep your files tidy and clean by organizing your symbols, layer styles and text styles in a Finder-like-UI.

Go give ’em a try and let us know how they worked for you!

Conclusions

Importing stuff from other files can easily generate a mess. This plugin will hopefully ease the process and help you keep your Sketch files clean.

That’s all, folks! Hope it helps!

Big big kudos to Invision team for this cool Atlas freebie 🤗.

Design + Sketch

The best collection of articles, tips, tutorials, and…

Design + Sketch

The best collection of articles, tips, tutorials, and stories on designing and prototyping with Sketch and beyond

Oscar Oto

Written by

Oscar Oto

I design and build software. Also write about UX and design techniques, and build Sketch plugins sometimes. You may also know me as oodesign.

Design + Sketch

The best collection of articles, tips, tutorials, and stories on designing and prototyping with Sketch and beyond

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store