All Projects → perrysmotors → Copy Framer Code

perrysmotors / Copy Framer Code

Licence: apache-2.0
A Sketch plugin that copies any selected layer to the clipboard as code that can be pasted straight into a Framer prototype.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Copy Framer Code

Symbol Instance Renamer
Rename symbol instances to the name of their master.
Stars: ✭ 164 (-18.41%)
Mutual labels:  sketch-plugin, sketch
Sketch Style Master
Sketch plugin for renaming shared styles
Stars: ✭ 193 (-3.98%)
Mutual labels:  sketch-plugin, sketch
Html Sketchapp
HTML to Sketch export solution
Stars: ✭ 1,811 (+801%)
Mutual labels:  sketch-plugin, sketch
Sketch Iconfont
This plugin helps you easily insert and manage icons from icon fonts.
Stars: ✭ 1,980 (+885.07%)
Mutual labels:  sketch-plugin, sketch
Sketch Palettes
A Sketch plugin for exporting and importing fill presets. It supports colors, gradients, and pattern fills.
Stars: ✭ 2,267 (+1027.86%)
Mutual labels:  sketch-plugin, sketch
Library Symbol Replacer
Sketch plugin to replace symbols in an existing documents with library symbols 💎 📚
Stars: ✭ 193 (-3.98%)
Mutual labels:  sketch-plugin, sketch
Sketch Navigator
Artboard navigation (with autocomplete) for Sketch.
Stars: ✭ 161 (-19.9%)
Mutual labels:  sketch-plugin, sketch
Sketch Batch Create Symbols
A plugin for Sketch to convert selected layers to individual symbols.
Stars: ✭ 134 (-33.33%)
Mutual labels:  sketch-plugin, sketch
Picasso
一款sketch生成代码插件,可将sketch设计稿自动解析成前端代码。
Stars: ✭ 191 (-4.98%)
Mutual labels:  sketch-plugin, sketch
Symbol Instance Locator
Locate all instances of a selected symbol or instance.
Stars: ✭ 150 (-25.37%)
Mutual labels:  sketch-plugin, sketch
Sketch2ae
A Sketch plugin to export sketch file to Adobe After Effect
Stars: ✭ 170 (-15.42%)
Mutual labels:  sketch-plugin, sketch
Icondrop
Get access to 2 million+ design resources right inside Adobe Xd, Figma, Sketch, Microsoft Office, G Suite and many more.
Stars: ✭ 174 (-13.43%)
Mutual labels:  sketch-plugin, sketch
Fake Chinese Name For Sketch
生成随机中文人名的 Sketch 插件
Stars: ✭ 141 (-29.85%)
Mutual labels:  sketch-plugin, sketch
Sketch Tailwind
A plugin that tries to bridge the gap between designs and code. Sketch Tailwind lets you export aspects of a design made in Sketch to a javascript theme file that you can import into your TailwindCSS config
Stars: ✭ 166 (-17.41%)
Mutual labels:  sketch-plugin, sketch
Logodrop
A Sketch Plugin to get brand logos right into Sketch App.
Stars: ✭ 140 (-30.35%)
Mutual labels:  sketch-plugin, sketch
Symbol Swapper
Swap the selected symbols and/or symbol instances to a master of the same name in a library.
Stars: ✭ 179 (-10.95%)
Mutual labels:  sketch-plugin, sketch
Sketch Copy Paste Position Size
A Sketch plugin that lets you easily copy & paste width, height, x & y values from and to objects
Stars: ✭ 130 (-35.32%)
Mutual labels:  sketch-plugin, sketch
Exporter
A Sketch plugin that exports Sketch artboards into clickable HTML file.
Stars: ✭ 131 (-34.83%)
Mutual labels:  sketch-plugin, sketch
Sketch Palette Generator
Output a JSON colour palette to Sketch 💎
Stars: ✭ 148 (-26.37%)
Mutual labels:  sketch-plugin, sketch
Paddy Sketch Plugin
Automated padding, spacing and alignment for your Sketch layers
Stars: ✭ 2,219 (+1003.98%)
Mutual labels:  sketch-plugin, sketch

Copy Framer Code plugin for Sketch

Download from Sketchpacks.com Compatible Sketch Version

A Sketch plugin that copies selected layers to the clipboard as code that can be pasted straight into a Framer prototype.

  • Copy one or more layers, or an entire artboard
  • Layers are copied in position
  • Rectangles, circles and text layers are drawn entirely in code*
  • Export @ 1x, @ 2x or @ 3x

*If a layer is too complex to draw using code alone you can make the plugin copy the code needed to include an image asset for the layer, but you will need to drag the image files into the project manually.

New in Version 3

  • Copy exported image assets

Features

  • Support for Nested Layers: Copy Framer Code exports all nested layers inside any selected groups, adding the parent property to the sublayers.
  • Export artboards: Select an artboard to copy all of its contents.
  • Flatten groups to a single layer by adding * to the end of the layer’s name.
  • Hidden layers are not imported.

Install

  • Download the latest release of the plugin
  • Un-zip
  • Double-click on copy-framer-code.sketchplugin

or...

Install Copy Framer Code with Sketchpacks

Usage

Sketch Import in Framer Studio creates layers in your Framer project by exporting image assets from your Sketch file. It’s quick and easy, but it has some limitations. While you can control opacity and scale in your prototype, properties such as colour, border radius and thickness, shadows and text values are not accessible.

This plugin takes a different approach. It aims to recreate as much of your design as possible using native Framer code so you have complete control.

All it does is copy code to the clipboard. Here’s how to use it:

  1. Select the layers or artboard in Sketch you want to copy.
  2. If you want to export from Sketch @ 1x, select Copy Framer Code > Copy @ 1x from the Plugins menu. Select Copy Framer Code > Copy @ 2x to double the scale of your design, and Copy Framer Code > Copy @ 3x to scale up by three.
  3. Paste the CoffeeScript code into Framer.

copytoframer

What layer types can the plugin handle?

Rectangles

Here is an example of the code that will be generated when you select a rectangle showing the full set of properties that can be generated:

rectangle = new Layer
	x: 276
	y: 40
	width: 200
	height: 100
	backgroundColor: "rgba(243,244,250,1)"
	borderRadius: 8
	borderColor: "rgba(183,190,208,1)"
	borderWidth: 2
	shadowColor: "rgba(0,0,0,0.25)"
	shadowX: 0
	shadowY: 4
	shadowBlur: 8
	shadowSpread: 0
	opacity: 0.9

Circles

Circles are created by setting the border radius of the layer to half its width:

circle = new Layer
	x: 312
	y: 220
	width: 128
	height: 128
	backgroundColor: "rgba(243,244,250,1)"
	borderRadius: 64
	borderColor: "rgba(183,190,208,1)"
	borderWidth: 2
	shadowColor: "rgba(0,0,0,0.25)"
	shadowX: 0
	shadowY: 4
	shadowBlur: 8
	shadowSpread: 0
	opacity: 0.9

Text

Text is copied as a native text layer:

text = new TextLayer
	x: 218
	y: 432
	text: "Type something"
	fontSize: 38
	fontFamily: "Gotham SSm"
	fontWeight: 500
	letterSpacing: -0.4
	lineHeight: 2
	textAlign: "center"
	textDecoration: "underline"
	textTransform: "uppercase"
	color: "rgba(75,79,96,1)"
	shadowColor: "rgba(0,0,0,0.25)"
	shadowX: 0
	shadowY: 4
	shadowBlur: 8
	opacity: 0.9

Groups

Groups are copied along with any child layers:

group = new Layer
	x: 328
	y: 572
	backgroundColor: "transparent"
	width: 96
	height: 40

sublayer2 = new Layer
	parent: group
	x: 0
	y: 0
	width: 40
	height: 40
	backgroundColor: "rgba(216,216,216,1)"

sublayer1 = new Layer
	parent: group
	x: 56
	y: 0
	width: 40
	height: 40
	backgroundColor: "rgba(216,216,216,1)"

You can stop the plugin from copying child layers by adding * to the end of the layer’s name in Sketch.

Artboards

You can select an artboard to copy all of its contents. The plugin creates a layer for the artboard itself so that you can use the screen in a flow component:

artboard = new Layer
	x: 0
	y: 0
	backgroundColor: "transparent"
	width: 750
	height: 1334

Make sure there are no export settings set for the artboard.

Symbols

The plugin cannot export the contents of symbols. Only position, size and opacity are copied. If you want the plugin to export and any layers inside a symbol you will first need to detach the symbol:

symbol = new Layer
	x: 248
	y: 668
	width: 254
	height: 96
	opacity: 0.9

Slices

Slices are ignored.

Everything else

Ovals, combined shapes, paths, images etc. are all created as layers with position and size only.

combinedShape = new Layer
	x: 272
	y: 844
	width: 206
	height: 136

What layer styles can the plugin handle?

  • Fill
  • Border
  • Drop shadow
  • Corner radius
  • Layer opacity
  • Font size, family and weight
  • Line height
  • Character spacing

A Sketch layer can have multiple fills, borders and shadows. This is not possible in Framer. When a layer has more than one of any of these style, only the top-most style is copied. Outside and centre borders are converted to inside borders as this is all that Framer can handle.

How include image assets

When the design of a layer cannot be represented using native code you will need to use an image asset:

combinedShape = new Layer
	x: 272
	y: 844
	width: 206
	height: 136
	image: "images/Combined Shape.svg"

Here’s how:

  1. Select the layer in Sketch and click Make exportable.

This tells the plugin to include a reference to the image in the code it generates. If you have set multiple export settings, the plugin will try to choose an export format that matches the scale you are exporting at. Failing that it will use the first in the list. Adding export settings to rectangles, circles and text layers has no effect as it is assumed these will be drawn using native code.

  1. Click the export button and export the image to the images folder in your Framer project.

Making rectangles, circles or text exportable has no effect because it is assumed these types of layer will be created using code alone.


If you are using this plugin, please 'star' this project. It's a simple way to help me see how many people are using it.

If you love this plugin, why not shout me a coffee ☕️ via PayPal to share the love!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].