Skip to content

Instantly share code, notes, and snippets.

@robkovacs
robkovacs / figma-copy.md
Last active January 10, 2025 15:07
Copy Figma objects via JS
  1. Copy the object in Figma
  2. Open Clipboard Inspector or a tool like it that can read the raw data off your clipboard.
  3. When you paste the Figma object into this tool, you should see something that's type text/html, and possibly something of type text/plain. The text/plain one will be the text content of your object, which you can ignore.

In the text/html, you're looking for:

  1. An HTML comment starting with figmeta:
@robkovacs
robkovacs / oately.css
Created June 7, 2023 13:39
Import Oately via CSS
@font-face {
font-family: "Oately";
src: local("Oately-BoldDisplay"),
url("https://css.justworks.com/fonts/Oately-BoldDisplay.woff2")
format("woff2"),
url("https://css.justworks.com/fonts/Oately-BoldDisplay.woff")
format("woff"),
url("https://css.justworks.com/fonts/Oately-BoldDisplay.ttf") format("ttf");
font-weight: 800;
font-display: swap;
@robkovacs
robkovacs / redraw_text_layers.cocoascript
Last active June 23, 2016 20:53
A quick and dirty way to redraw all your text layers in Sketch - useful if you switch between versions of a font (Typekit to non-Typekit, for example).
function check_layer(layer) {
switch ([layer class]) {
case MSTextLayer:
var fs = [layer fontSize] + 1;
layer.setFontSize(fs).setFontSize(fs - 1);
break;
}
}
var doc = context.document;