ingrammicro / puzzle-tokens Goto Github PK
View Code? Open in Web Editor NEWBatch create, manage and update Sketch styles and symbols using SCSS/LESS
License: GNU General Public License v3.0
Batch create, manage and update Sketch styles and symbols using SCSS/LESS
License: GNU General Public License v3.0
PROCESS /Users/vincentk/Versions/ConnectApp/connect_app_atomic_library-vm.sketch
APPLY STYLES...
TypeError: undefined is not an object (evaluating 'this.pathToSource.substring')
at run (/Users/vincentk/Library/Application Support/com.bohemiancoding.sketch3/Plugins/PuzzleTokens.sketchplugin/Contents/Sketch/cmdline-functions.js:2007:52)
at runFromCmd (/Users/vincentk/Library/Application Support/com.bohemiancoding.sketch3/Plugins/PuzzleTokens.sketchplugin/Contents/Sketch/cmdline-functions.js:1979:33)
at applyStyles (/Users/vincentk/Library/Application Support/com.bohemiancoding.sketch3/Plugins/PuzzleTokens.sketchplugin/Contents/Sketch/cmdline-functions.js:4058:22)
at /Users/vincentk/Library/Application Support/com.bohemiancoding.sketch3/Plugins/PuzzleTokens.sketchplugin/Contents/Sketch/cmdline-functions.js:4131:36
at value (/Applications/Sketch.app/Contents/Resources/SketchAPI_dom.js:1:32133)
at cmdRun (/Users/vincentk/Library/Application Support/com.bohemiancoding.sketch3/Plugins/PuzzleTokens.sketchplugin/Contents/Sketch/cmdline-functions.js:4119:18){"file":"/Users/vincentk/Versions/ConnectApp/connect_app_atomic_library-vm.sketch","saveAs":"/Users/vincentk/Versions/ConnectApp/connect_app_atomic_library-sunrise.sketch","styles":"/Users/vincentk/Documents/design-assets/Sunrise/Css/Sunrise.less","commands":"apply,save,close"}
HI @MaxBazarov
I get this error after updating, havent changed anything to my code, just updated sketch and your plugin?
?I updated Sketch today to the latest version, and when I run my Puzzle token commands it crashes Sketchtool
Sketch Version 78 (131919)
Puzzle Tokens version: 8.17.0
Not really sure where the problem comes from :/
Would love to have the possibility to add Text Decorations to a style like:
text-decoration:underline;
Separate the pages further by 'which library' the style comes from, so that people using multiple libraries for different elements have them organized that way. Colors, Icons, Typo etc. and also can catch inconsistencies where styles are used from other libraries.
josh-tt
@josh1111
6:43am
I just did a test with a new file.
Create a layer in sketch called colors / black(add extra space with cursor here)
Create a style from it
Create a document in puzzle tokens with .colors .black
A new style with be created and you end up with two. So, you have to write .black__ in the scss file and look out for any extra spaces people may have used when creating styles.
Spaces at the end of a style are hard to visually identify, so I missed that one several times. If you try to find the style later, it seems that sketch corrects the space (at least in the latest version), so it looks normal in the components panel which makes it even harder to find, but in the code where sketch stores the style it must still have the space.
Edited
7:07am
Attaching an example example to test, one sec: https://drive.google.com/file/d/17_y3mg_fGzwv_KKaMdaJAMJKl7EdGscC/view?usp=sharing
7:17am
Perhaps, some sort of simple hack debugger that finds styles that are exactly the same, looking (with the exception of spaces) gives you a hint that says - "these two styles were found identically named, but have different spacings, which sketch will interpret to be a new style" would be really helpful to catch on import.
Actually, an alphabetical 2-column inventory would be really useful to debug/check things in general so you can see the old style vs new style. Spaces could be highlighted.
I've made a shell script that loads a sketch fle, runs puzzle tokens from SketchTool and saves the file with another name.
Since last week when run the script, all my fles have the same .less file applied to them. instead of using different ones like before.
When I run PT from sketch everything works fine. What could be wrong?
Hey, thanks for the plugin.
There is some way to define name of the .less or .sass file that are exported with help of puzzle-tokens
?
Probably a bit an edge case, but maybe easy to fix?
I want to use the character ฮฉ
in the class/layer style name.
This because it is later in the alphabet, and thus later in the list.
I always get the error
Failed to parse SASS with error message:
Cannot read property 'props' of null
I guess it is not an allowed classname in css. would it be possible to fix it e.g. with the --PT-
prefix?
If not also fine, then I know I need to go for another solution.
Hi, would it be possible to use "mix-blend-mode" in this plugin in some way? If so, how?
Would love to see the letterspacing
CSS property adopted. Let me know if there is any information I can provide to help with this. Thanks!
I'm creating border variations, and have noticed that the CSS attribute "border-style" is not implemented. Is this planned? Specifically looking to implement the following border styles, in addition to the "solid" default:
dashed
dotted
double
Thanks!
Mike Bronner
@mikebronner
ENOENT: no such file or directory, open '/Users/my-user-name/Library/Application%20Support/com.bohemiancoding.sketch3/CloudDocuments/813d2e60-b534-4276-8d04-20a31f48bb7f/puzle-tokens-text-and-layer-styles-vars.scss'
I am not 100% what goes wrong here? But it seems the in-between JSON/CSS file is not saved correctly.
A workaround, for now, is to make it a local document and then save it to the cloud manually. But ideally would like to see this fixed.
Thanks for the great plugin ๐ let me know if you need additional details.
It is beneficial to create styles that only contain opacity settings without any other attributes. This would allow us to apply them to groups and other containers as a whole.
I attempted this, but the plugin doesn't seem to create the styles correctly. I tried both decimal and percentage values.
.Opacities .0 {
opacity: 0;
}
.Opacities .25 {
opacity: 0.25;
}
.Opacities .50 {
opacity: 0.5;
}
.Opacities .75 {
opacity: 0.75;
}
.Opacities .100 {
opacity: 1;
}
Started
Read LESS: running...
/usr/local/lib/node_modules/less
internal/modules/cjs/loader.js:797
throw err;
^
Error: Cannot find module '/usr/local/lib/node_modules/less'
Require stack:
- /private/var/folders/k8/vy_1t24s075cnqhjpy2f6qx80000gn/T/nsconvert_less.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:849:19)
at require (internal/modules/cjs/helpers.js:74:18)
at transformLESStoJSON (/private/var/folders/k8/vy_1t24s075cnqhjpy2f6qx80000gn/T/nsconvert_less.js:96:16)
at Object.<anonymous> (/private/var/folders/k8/vy_1t24s075cnqhjpy2f6qx80000gn/T/nsconvert_less.js:27:1)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/private/var/folders/k8/vy_1t24s075cnqhjpy2f6qx80000gn/T/nsconvert_less.js'
]
}
Less is installed:
which less
/usr/bin/less
Any suggestions? Thanks!
Love the new Generate Style Overview feature in the latest release. When I generated the style, I did noticed that it added two extra characters to the Hex value as well as a border color to the label text. https://drive.google.com/file/d/1WQ9nrBDClYtKZj40pOrfpOZ7nFisafPB
font-weight:light; is not working with Roboto. Didn't try with other fonts.
When I apply the Design Tokens in Sketch the font-weight added is regular.
other Font-Styles as thin or bold are working correctly
Your plugin is very useful!
Can I link the color variable to the layer style or text style? I want those styles will link with the color variable.
Hey, the opacity property for Textstyles doesn't seem to work โฆ
Other than that great plugin!
I have tried importing demo .less files from the repository, and creating some of my own but I was stuck with the error that opened in plugin window.
"Error: An Obj-C exception occurred."
I am using macOS Mojave and the latest sketch 66.1
(I'll try to upload a screenshot later, firewall restrictions atm.)
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.