Skip to content

Your best friend when working with Figma designs

License

Notifications You must be signed in to change notification settings

Pitu/figma-overlay

Repository files navigation

Figma overlay

NPM version GitHub license Support Support me

Figma overlay is a drop-in component to create an overlay over your website to compare it to it's figma counterpart

It works by grabbing the page/component svg from your clipboard and creating a floating image for you to drag around and compare, letting you move it per-pixel using the arrow keys and changing the opacity for easy comparison.

Figma overlay is a Web Component so it works with any framework

IntroductionInstallation

Introduction

In an effort to aid the gap between a Figma design and the implementation counterpart this tool aims to make it easier for developers to achieve pixel-perfect implementation of designs. The workflow consists on opening a figma design, selecting a component, right clicking it and selecting copy and finally selecting Copy as SVG

Once this is done, you can now go to your website running Figma-overlay and click the floating button sitting on the lower-left corner of your screen

And that's it! Now you can drag the overlay around, use the arrow keys to tune the position and the slider to change opacity and compare what you did against what you have to.

Installation

Figma overlay is a Web Component which means you can use it with any framework you like by importing it properly. This small guide will only cover how to add it to the browser and to Vite based projects, specifically with Vue. If you get it up and running with other setup and want to contribute, please make a PR to ammend the instructions.

With Vite

npm i figma-overlay

Then import the component

import FigmaOverlay from 'figma-overlay';

Add it to your html as follows.

<figma-overlay></figma-overlay>

And make sure to add figma-overlay as a Custom Element in vite.config.ts

...
plugins: [
  vue({
    template: {
      compilerOptions: {
        isCustomElement: tag => tag.includes('figma-overlay')
      }
    }
  })
],

In the browser

Add the script at the end of your body tag

<script src="https://unpkg.com/figma-overlay@latest"></script>

or

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/figma-overlay.umd.min.js"></script>

And then ideally place the component right after the body

...
<body>
	<figma-overlay></figma-overlay>
	...
</body>

Author

Figma-overlay © Pitu, Released under the MIT License.
Authored and maintained by Pitu.

GitHub @Pitu

About

Your best friend when working with Figma designs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published