You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get around Sketch's strict limitation of one alignment and colour per text style, some Sketch projects are set up with text styles that may look like this:
TextStyle1/Left/White
TextStyle1/Centre/White
TextStyle1/Right/White
TextStyle2/Left/White
TextStyle2/Centre/White
TextStyle2/Right/White
There should be a parameter to treat these namespaced text styles as the same style, so that only TextStyle1 and TextStyle2 would be exported.
The issues that need to be resolved are:
Checking that all namespaces styles share the same other variables, e.g. make sure TextStyle1/Left/White has the same point size as TextStyle1/Centre/White.
Which identifier to use? There will be multiple identifiers for each style, and between runs of stylesync there may be identifiers added or removed. It's vital that stylesync has a persistent reference to a style's identifier
The text was updated successfully, but these errors were encountered:
In the current implementation, it's possible for every variable except the identifier to change and for stylesync to handle this well. This means that the identifier is the only source of truth. When running in a mode to support this hack, it's possible that the identifiers could also completely change, so the best solution I can think of so far is:
each text style keeps an array of all the identifiers associated with it from the current run
the next time the script runs, it tries to find any of those identifiers, and use that to have knowledge of a style name
The case this doesn't handle is that all the identifiers of all the namespaces styles changes between runs, however this is an edge case. Hopefully Sketch starts properly supporting mutable alignment and colours in text styles soon, which will remove the necessity for the original hack.
Since a namespaces style will be formed of multiline styles that will have different colour values, it will not be able to export a colour. Using namespaced styles within Sketch is exactly to get around the issue of having multiple colours and the same name, so this shouldn't be a problem in practise.
To get around Sketch's strict limitation of one alignment and colour per text style, some Sketch projects are set up with text styles that may look like this:
There should be a parameter to treat these namespaced text styles as the same style, so that only TextStyle1 and TextStyle2 would be exported.
The issues that need to be resolved are:
stylesync
there may be identifiers added or removed. It's vital thatstylesync
has a persistent reference to a style's identifierThe text was updated successfully, but these errors were encountered: