What is the correct setup for sketch palette?
See original GitHub issueI’ve included an example. I have the files created with the init build, everything else works (removed my js outputs). I don’t think the filter is working, but if someone has an example of sketch much appreciated 😃
"source": [
"properties/**/*.json"
],
"platforms": {
"scss": {
"transformGroup": "scss",
"buildPath": "build/scss/",
"files": [
{
"destination": "_tokens.scss",
"format": "scss/variables"
}
]
},
"sketch": {
"transforms": ["color/sketch"],
"buildPath": "build/sketch/",
"files": [
{
"destination": "tokens.sketchpalette",
"format": "sketch/palette/v2"
}
],
"filter": {
"attributes": {
"category": "color",
"type": "base"
}
}
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Fusion 360 Help | Sketch Palette reference | Autodesk
The Sketch Palette dialog displays in the canvas when you create or edit a sketch in Fusion 360. The palette contains commonly used...
Read more >Design workflow quick tip #5 — Color Palettes in Sketch
Open a new/ existing Sketch document · Go to Plugins>Sketch Palettes>Document Colors> Load Palette · In the window that opens, go to palette ......
Read more >Creo Customization: Custom sketch palette - YouTube
You will learn how to create and define Custom sketch paletteIf you enjoy my content, please consider supporting what I do: Buy a...
Read more >Sketch palette plugin for Sketch app - Loading palette - YouTube
A video for a blog post where I talk about a Sketch app plugin Sketch Palette. This video shows how to load a...
Read more >How to save color palettes in Sketch - YouTube
Wishing there was a way to better manage multiple color palettes in Sketch without endlessly adding to your "Global Colors" area?
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Awesome! Yea a bit about those warnings. When Style Dictionary tries to build a file it will check for name collisions in the format, name collisions could happen because maybe a name transform is causing names to be duplicated. In your case it was because you didn’t have any name transform applied (my bad, I forgot that), and by default each token’s name is its’ key in the object. So having multiple keys of
_40k
even though they were at different parts of the object caused them to override each other when outputting a flat array like in a sketch palette. Although not much harm would have come, but just the names of the sketch colors would not be intelligible.Here is the PR that added those warnings: https://github.com/amzn/style-dictionary/pull/273
Okay, fixed it. It was my names: The winning config:
Hopefully will help peeps in future and thanks for you help @dbanksdesign 😃