This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Niels van Hoorn
Posted Oct 31 - Read on Facebook

During our meetup yesterday I was talking to Maarten Werner, about applying the style of Sketch text layers to a Framer layer.
This is some (intentionally, because subject to change) undocumented API some of you might not know yet, so here's an example of how you might do that:

applyStyles = (sketchLayer) ->
. sketchLayer.image = null
. sketchLayer.html = sketchLayer._info.metadata.string
. for style in sketchLayer._info.metadata.css
. . if _.startsWith style, '/*'
. . . continue
. . matches = /(.*):\s*(.*);/.exec(style)
. . sketchLayer.style[matches[1]] = matches[2]

Here's how you would use it:
http://share.framerjs.com/dwna15strtma/

It's not perfect (try disabling the "sketchLayer.image = null" line to see the differences), but still might come in handy in some cases.

1 Comments

Jordan Robert Dobson

Nicolas Elizaga - This Friday let's try this out.

Read the entire post on Facebook