Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Once Detached—Unable to Create Styles #32

Closed
MarkThomasJohnson opened this issue Apr 10, 2019 · 6 comments
Closed

Once Detached—Unable to Create Styles #32

MarkThomasJohnson opened this issue Apr 10, 2019 · 6 comments

Comments

@MarkThomasJohnson
Copy link

Summary

I believe once you detach a text style from a layer, the plugin is unable to create new text styles for the any new or existing layers which have no text style applied. As in, the file is no longer able to "Create" new styles. You are however, able to update layers with existing styles.

Example:

  1. I opened an existing file to expand the text styles available.
  2. I duplicated a list of layers with type styles applied to them. Adjusted the type, then detached the layer style.
  3. I tried to use the plugin to create new styles, but the plugin appeared to do nothing. (no feedback other than the menu flashing) Fig. 1 below*

2019-04-10 17 29 29

Figure 1: Selecting text laters and attempting to create from both the menu and the hotkey yielded no results.

Troubleshooting/Pinning down the issue:

  1. I copied the text from this file some with styles applied, the rest with the text styles detached (e.g. H1 and H2 are text styles, H3–H6 are just text layers and named in order to be generated into styles properly.)
  2. Used the plugin. No issues. The layers with text styles applied that I copied in that had just "updated" or "didn't update since there was no change", while it created the other 64 instances. (Worked normally).

Quick Fix / Alternate Path

I found by copying the detached style layers (properly named), and pasting them in a new file—I was able to generate the styles there. Following that I then copy/pasted them back into the origin file and the styles transferred. So this may mean I have a Sketch or file corruption issue in some way, but I'm not certain.

Hope this info is helpful.

@lucaorio
Copy link
Owner

Hey @MarkThomasJohnson, thank you so much for providing such accurate description! 🙏

I've tried to replicate the problem, but everything seems to work well here. Am I missing anything / misunderstood your issue?

github-issue

@MarkThomasJohnson
Copy link
Author

Hey @lucaorio for sure! 👍

It appears you're using the newest version of Sketch, so perhaps that solves it, or my file is somehow moderately broken. I can't really pin down why it won't work within this particular file.

I tried doing this exact thing you did with another file and it worked as usual.

It's just weird that it won't create any new styles within this file anymore. I tried to reproduce this bug in a new file, but I can't reproduce the exact issue. I'm not totally sure what caused it to break.

My steps in general was taking multiple text layers (8ish layers) with a text style applied. Adjusting the text layers first, then renaming, then duplicating that new set of 8, doing the same until I was at ~64 styles total. Then detaching the text styles (as they were all the original style with an override applied effectively) then trying to use the plugin, it didn't work. And if I tried to just use the plugin without detaching it would just apply one style to all of them (update all styles to match somehow).

Is there anything else helpful I can try to do?

@lucaorio
Copy link
Owner

I think the last behavior you were describing is intended.

From the FAQ:

The layer has no shared style applied, and no existing shared style matches its name:
- Create a new shared style

The layer has no shared style applied, but there's a shared style that shares its name:
- Apply the shared style to the layer

The layer has a shared style applied, and its synced, but there's a mismatch between the names
- The shared style is renamed to match the layer

The layer was changed, and is now out-of-sync with the shared style applied to it:
- The shared style, and all its instances are synced

The layer was changed in both its appearance, and name, but still connected to a shared style:
- The shared style, and all its instances are synced and renamed

I don't know what's going on in your file, I would have to open and take a look at the ids in order to understand.

If you were previously using an older version, and it was working well, you still have access to all of them from this page: https://github.com/lucaorio/sketch-styles-generator/releases

@kst0rm
Copy link

kst0rm commented Apr 15, 2019

I'm having a similar issue. I created a few color styles and then cleared out the text styles before creating a new one and the plugin would not prompt successful. Reverted back to 1.4 to get it back in working order.

@lucaorio
Copy link
Owner

@MarkThomasJohnson @kst0rm Could you please install Sketch Dev Tools, and let me know if any error is triggered?

@lucaorio
Copy link
Owner

lucaorio commented May 5, 2019

@MarkThomasJohnson @kst0rm I'm closing this, but please let me know if you had any chance to run the Sketch Dev tool 👍

@lucaorio lucaorio closed this as completed May 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants