A Sketch snippet to copy global colors to the pasteboard
✓ Published0🌍 Public
KKevinGutowski
Last edited May 18, 2019
Created on May 18, 2019
This sketch copies all global color assets from a Sketch document to the clipboard as CSS rules, converting each color to hex and generating class names. It uses the Sketch JavaScript API (`sketch.globalAssets`) to access color assets and `NSPasteboard` to write the formatted string. The code iterates through every saved color, builds a CSS block with a `.colorN` selector or the asset’s name, and trims trailing whitespace before showing a confirmation message.
AI-generated description