How to copy CSS from a layer in Figma

Copy the CSS for any Figma layer without Dev Mode: select the layer, right-click it, then choose Copy/Paste as, Copy as code and CSS.

Quick answer

Select the layer in the Layers panel, right-click it, and open Copy/Paste as. Choose Copy as code, then click CSS. Figma copies the layer's CSS to your clipboard, so you can paste it into your code editor. This works on the Free plan without switching to Dev Mode.

Steps at a glance

  1. Select the layer in the Layers panel
  2. Right-click the layer
  3. Open Copy/Paste as
  4. Choose Copy as code
  5. Click CSS

Interactive demo

Loading demo…

Summary

Figma can turn a layer's styling into CSS you paste straight into your code. The option sits in the layer's right-click menu, so you do not need to open Dev Mode. It saves you from reading sizes and colors off the Design panel by hand.

Step-by-step guide

  1. Step 1

    Select the layer

    Open your design file and find the layer in the Layers list on the left. Click Frame 1 or whichever layer you want to copy CSS from. The Design panel on the right updates to show that layer's properties.

  2. Step 2

    Right-click the layer

    Right-click the selected layer in the Layers list. A context menu opens with copy, paste and layer options. Right-clicking the layer on the canvas opens the same menu.

  3. Step 3

    Open Copy/Paste as

    In the context menu, hover over Copy/Paste as. A submenu opens with copy formats such as Copy as code, Copy as SVG and Copy as PNG.

  4. Step 4

    Choose Copy as code

    Hover over Copy as code in the submenu. A further list of code formats opens beside it.

  5. Step 5

    Copy the CSS

    Click CSS to copy the layer's styles as CSS. The list also offers CSS (all layers), iOS and Android. Paste the result into your code editor.

Why this matters

You are building a component from a design and need its exact size, fill and corner values. Copying the CSS from the layer gives you those values in one paste, so you skip retyping numbers and avoid small mismatches with the design.

Frequently asked questions

  • Do I need Dev Mode to copy CSS?

    No. The CSS option in the Copy as code menu was available in the Design view on the Free plan. The menu points to Dev Mode for other code formats.

  • What other formats can I copy the layer as?

    The Copy as code list also showed iOS and Android, and the Copy/Paste as submenu offers Copy as SVG and Copy as PNG.

Create interactive demos like this one — free, no coding required.

Start for free →