nilshoenson / shared-text-styles Goto Github PK
View Code? Open in Web Editor NEWA Sketch plugin to import & export text styles.
Home Page: http://www.textstyl.es/
License: MIT License
A Sketch plugin to import & export text styles.
Home Page: http://www.textstyl.es/
License: MIT License
There are a handful of plugins to manage text and layer styles, however most of them are dead, stalled, or not great. I suspect you would find a lot of new users once you add the ability to import/export layer styles too.
Better yet, some sort of Inventory Management or a visual display of the styles in a grid, would be even better.
Not certain yet, but importing text styles with this plugin in sketch seems to have an effect on https://zeplin.io/ 's style guide feature. Normally, when you upload your sketch files to zeplin, they recognize new text styles in the document and suggest adding them to zeplin's styleguide feature.
See screenshots about how zeplin works if I upload a new file with new text styles:
These notifications do no occur if uploading files with text styles imported with this plugin.
Not sure, but thinking this plugin might inject some extra meta data into the json file which is causing zeplin to fail to recognize the new styles?
Nothing is happen if I import .json file.
If this is still working, Method 1 references Sketch Toolbox which I believe is no longer a thing. Correct me if I'm wrong
Hello, using latest version of the plugin and sketch, when i import my json file with the plugin, almost every styles are corrupt, specially in the fill color and paragraph settings.
Sketch crashes every time I try to import text styles. I have Sketch 48.1 and 1.4 of this plugin.
Hello Nils,
I am a ui designer from germany and want to use your very nice and helpful plugin „shared text styles“. It works very fine!
But during my tests I noticed, that the shadows in my text styles are not exported (I can not find something in the exported json).
I have to say, that I use the newest sketch version (44). I am not sure if the problem comes from there.
Do you know about that „bug“?
Thank you very much. Have a nice day!
Could it be possible to import an updated set of type styles, and it would override the existing styles with the new ones and apply the new styles to the existing design?
Colors don't seem to be exporting along with the rest of the text styles. I believe this may be a bug with Sketch v48 since it made several tweaks to color functionality.
As a test, I created a bright red text style:
After exporting and importing, this is the result:
Looking at the JSON, the color value is missing:
{"styles":[{"name":"Test","font":"DINPro-Medium","size":44,"color":{},"alignment":0,"spacing":0,"lineHeight":0,"textTransform":0}]}
Thanks for the help!
Hi there!
This is a quick note to remind you that Sketch 45 will include a plugin update system.
It would be awesome if you could add support to it (it's really easy!) before Sketch 45 comes out. Ideally, you should release an update for your plugin while we're still in Sketch 44, so your users will have a nice & easy experience when 45 is released.
For more details, please check http://sketchplugins.com/d/229-updating-plugins and http://developer.sketchapp.com/introduction/updating-plugins/
Thanks in advance!
Installed plugin
clicked export text styles
Nothing happens, no .json file created
As of 02.06.18, it stopped importing text styles.
Hey there,
If someone copies and pastes styled text from another document, it creates a new style even if the same exact style exists. Was hoping to see if this is something you know about or thinking about fixing?
Thanks!
I'm having trouble importing styles with the font "open sans" from an exported json. All of the styles is in "open sans" from the beginning, but when I try to import them into a new sketch file some of the styles are now showing the font "helvetica". Some of the styles are showing correct fonts though(open sans). Any idea what is wrong?
Regards,
Mathias
When I try to export my styles, no window appears to assign a name to the .json file. Unless I am missing something obvious from this process?
When importing text styles for the second time, the current styles should not get overwritten and should not be imported for the second time.
Importing a text styles file crashes my Sketch.
Trying to import into a Sketch a file with prior elements, and 2 other separate text styles.
Sketch 48.1
Mac OS 10.11.6
plugin version 1.5.2
Incident Identifier: C3C916CA-9E74-4083-B724-A20ED3E8EDE7
CrashReporter Key: 0DB29BAC-5A03-5DA0-BE5B-FA4C57FD32EB
Hardware Model: MacBookPro11,4
Process: Sketch [44376]
Path: /Users/USER/Documents/Applications/Sketch.app/Contents/MacOS/Sketch
Identifier: com.bohemiancoding.sketch3
Version: 48.1 (47250)
Code Type: X86-64
Parent Process: launchd [1]
Date/Time: 2018-01-04 08:58:17 +0000
OS Version: Mac OS X 10.11.6 (15G17023)
Report Version: 104
Exception Type: SIGABRT
Exception Codes: #0 at 0x7fff8e719f06
Crashed Thread: 31
Sketch Version 41.2
Hey, @nilshoenson!
When I import the Jason file into my Sketch file all the color styles are loosing. All colors have changed to #000. Also, the Line Through style doesn't work. Example:
Sketch Version: 47.1
Shared Text Styles: 1.5.2
I have the latest version of Sketch 47.1 and have a recent updated version of your plugin 1.4
My text styles are grouped by "/". But I cannot export any of text styles, grouped or ungrouped, unfortunately it doesn't work.
not all styles are moved =(
First thank you for an amazing plugin, literally the first thing I do when creating a new document is to import the correct text styles.
That is also why i'm devastated that it stoped working today after updating to sketch v43. It simply does not import the styles when choosing the json file.
Is it something you can fix🤞
Thank you so much
Importing feature does not work when I tried to import text styles JSON file which exported using this plugin. Nothing happened.
I checked console log using skpm log -f
command. Error informations are bellow,
TypeError: null is not an object (evaluating 'fileContents.toString')
line: 27
sourceURL: /Users/stewie/Library/Application Support/com.bohemiancoding.sketch3/Plugins/shared-textstyles.sketchplugin/Contents/Sketch/import.cocoascript
column: 49
stack: loadFonts@/Users/stewie/Library/Application Support/com.bohemiancoding.sketch3/Plugins/shared-textstyles.sketchplugin/Contents/Sketch/import.cocoascript:27:49
importFonts@/Users/stewie/Library/Application Support/com.bohemiancoding.sketch3/Plugins/shared-textstyles.sketchplugin/Contents/Sketch/import.cocoascript:84:14
Sketch shared text styles plugin does everything except actually export the text-styles.json file in Sketch 40.3.
When I import text styles from the .json file created from my master type library all attributes, size, line-height, letter spacing are copied successfully, however the attribute for transparency does not get exported into the .json file or somehow is not read when imported into the new doc.
This plugin cannot automatically update in Sketch Plugin Manager because it is missing an identifier in the manifest.json file. See http://developer.sketchapp.com/introduction/plugin-bundles/ for more info.
Export text styles option still doesn't working in Sketch 49.3. However import option works great.
When I export styles with 1.6.2 I can't import them in a new file. After selecting a .json file and confirming, nothing happens. I'm using the most recent version of Sketch and plugin.
Sketch.app version 40 introduces the ability to set Text Styles to lowercase or uppercase. This functionality also needs to be added to the Shared Text Styles plugin.
in manifest.json old version 1.5.2 (sketch update don't work)
I am trying to import text styles (the same file that I have been using previous to Sketch 50 update). Unfortunately after importing the text styles list is still blank. I am able to apparently export text styles, but it won't let me import anything after making a new file.
Greetings.
Seems like the latest update (1.6.3) wouldn't allow my team to sync the project to Invision via Craft Manager. From what we can tell from our troubleshoot, my teammates were using the latest update and they faced this issue. But I'm using the 1.5.2, and it works fine. They re-install back the plugin with v1.6.3 and it is working too.
It may sounds like the solution we found is not correlated to the issue, but I don't know how, it works. I hope it helps.
Steps to reproduce:
The script stops execution when reading the red color component from NSColor. So I assume color is null and thus the script crashes.
Hey, @nilshoenson! How would you feel about altering the behavior of the import function slightly? Specifically, imagine that you have two text layers in a document that you want to re-import text styles into:
Then, imagine that you re-imported a slightly altered version of the text styles (eg, you changed the font size). In this scenario, you probably wouldn't want to lose the color override you applied to Layer B.
My proposal is to preserve attributes that have been overridden in the target layer while only updating the attributes that hadn't been overridden.
To see an example of what I mean, take a look at this proof of concept plugin I created that replaces a text style with another text style while preserving overrides: https://www.dropbox.com/s/t1af68ciz65bzug/preserve%20overrides.mov?dl=0
If you'd be OK with this behavior change, let me know! I'd be happy to create a pull request for you to review. Thanks!
I there,
the plugin keep on crashing. I'm trying to export a quite big text style structure from a Sketch file, till here all smooth. But when I then import that file into another project, Sketch crashes almost immediately. Here some crash details:
Incident Identifier: 9894D7CA-C552-43F5-8044-E77E64E52A66
CrashReporter Key: 97B796DE-C699-5AD8-B7EE-D9182FB3CA29
Hardware Model: iMac14,2
Process: Sketch [8629]
Path: /Applications/Sketch.app/Contents/MacOS/Sketch
Identifier: com.bohemiancoding.sketch3
Version: 48.1 (47250)
Code Type: X86-64
Parent Process: launchd [1]
Date/Time: 2017-12-19 15:53:56 +0000
OS Version: Mac OS X 10.13.2 (17C88)
Report Version: 104
Exception Type: SIGABRT
Exception Codes: #0 at 0x7fff6ad51e3e
Crashed Thread: 20
I've been testing the plugin, and it works perfectly on my computer and different files and with some other people. However, it doesn't work with one of my colleagues. He has the same sketch version that I have, no other plugins and he has tried to reinstall both sketch and your plugin with no success.
He's able to import his own files (test-text-styles-1.json) but when I take his file, do a modification (test-text-styles-2.json), and he tries to import it then it doesn't work.
It'd be great to have this info in there, as importing resets all styles to zero which was not the same style I expected to export.
Importing the JSON file has no results.
Sketch 49.1
Plugin 1.6.2
4/3/18 1:06:33.932 PM Sketch[46881]: Exception: NSConcreteNotifyingMutableAttributedString addAttribute:value:range:: nil value
I was able to export/import from one Sketch file to another a couple of times without issue, and then it just stopped exporting. There were no error messages thrown. For a test, I put an empty text-styles.json file on my Desktop, exported from Sketch the /new/ text-styles.json, I was asked if I wanted to replace the existing file, to which I said yes and it seemingly "worked". However, when I opened the file, it was still empty.
Hello, Nils.
Congratulations on the plugin, it really is very useful. Excellent job!
I've realized that every time I import the Jason, he's missing the Line Through style.
Some data about my set up:
Sketch Version - 47.1
macOS Sierra V 10.12.6
Thanks!
Is it possible to also pull in the alignment and spacing details as well? The current set of data isn't quite enough for this to be useful for us. The styles default to left aligned and the line height being the same as the text size.
I got really excited about this plugin and was able to successfully export and import styles initially. But, I like to keep my styles organized by grouping them with "/." (Ex. Headers/H1/Desktop.) But once I group styles, I am unable to export.
I've tested it and was able to export another file that had styles which weren't grouped.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.