Master Figma Dev Mode for developer handoff — extract production-accurate CSS values, read design variables, inspect Auto Layout properties, download assets, and use annotations to understand design intent without asking the designer.
Figma Dev Mode (activated with Ctrl+Shift+D) is a developer-specific interface that transforms Figma from a design tool into a specification viewer. In Dev Mode, editing is disabled, measurement overlays are always active, and the right panel switches from design properties to developer-focused code generation.
For developers, Dev Mode eliminates most measurement conversations with designers. Every value you need — font metrics, spacing, colors, shadows, border radius — is visible in the Code tab with copyable CSS. Design variables appear with their names, letting you map them directly to CSS custom properties.
This lesson covers the complete Dev Mode workflow: activating it, navigating it, extracting values accurately, and using its advanced features for efficient implementation.
Figma Dev Mode is available to all Viewer roles (free) — you do not need an Editor seat.
Activating Dev Mode:
Dev Mode interface layout:
Left panel (Layers and Pages):
Canvas:
Right panel (Code and Inspect tabs):
Component panel (bottom of right panel):
Dev Mode breadcrumb:
Keyboard shortcuts in Dev Mode:
The Code tab generates CSS for any selected element. Unlike XD's CSS generation, Figma Dev Mode outputs rem values, unitless line-heights, and correct Flexbox properties from Auto Layout.
Selecting elements for CSS extraction:
Code tab sections:
For a button component:
1/* Figma Dev Mode generated CSS — close to production-ready */
2.btn-primary {
3 /* Auto Layout → Flexbox */
4 display: flex;
5 flex-direction: row;
6 align-items: center;
7 justify-content: center;
8 gap: 0.5rem;
9
10 /* Auto Layout padding */
11 padding: 0.875rem 1.5rem;
12
13 /* Fill */
14 background-color: #2563eb;
15
16 /* Border radius */
17 border-radius: 0.5rem;
18
19 /* Typography (from text child layer) */
20 font-family: 'Inter', sans-serif;
21 font-size: 0.9375rem;
22 font-weight: 600;
23 line-height: 1.467; /* unitless — correct */
24 color: #ffffff;
25}For a text layer, the Code tab shows typography specifically:
1.label-text {
2 font-family: 'Inter', sans-serif;
3 font-size: 1rem;
4 font-weight: 500;
5 line-height: 1.5;
6 letter-spacing: 0;
7 color: #374151;
8}For a frame with Auto Layout:
1.card-body {
2 display: flex;
3 flex-direction: column;
4 align-items: flex-start;
5 gap: 0.5rem;
6 padding: 1rem;
7}Remaining manual corrections after Figma CSS:
Copying individual properties:
Figma Variables (design tokens) appear in Dev Mode with their variable names — not raw hex values — when the designer has applied them correctly. This is the key advantage over reading one-off colors.
How variables appear in Dev Mode:
Translating Figma variable names to CSS custom properties:
1Figma variable name CSS custom property
2--color/primary/600 → --color-primary-600: #2563eb
3--color/neutral/900 → --color-neutral-900: #111827
4--spacing/4 → --space-4: 1rem
5--typography/body/md → Use as .text-body-md class reference
6--radius/lg → --radius-lg: 0.75remWhen Figma shows variables in the Code tab:
1/* With variables applied by the designer */
2.card {
3 background-color: var(--color-bg-surface, #f9fafb); /* variable name + fallback */
4 border-color: var(--color-border, #e5e7eb);
5 border-radius: var(--radius-lg, 0.75rem);
6}
7
8/* Without variables (hardcoded design) */
9.card {
10 background-color: #f9fafb;
11 border-color: #e5e7eb;
12 border-radius: 0.75rem;
13}When to use a CSS variable vs a hardcoded value:
Checking the Variables panel in Figma:
Design mode values panel during code review:
Dev Mode provides direct asset export and a dedicated annotations system for developer-specific notes.
Exporting assets from Dev Mode:
Export settings best practices:
1SVG: icons, logos, illustrations, decorative graphics
2 Always choose SVG first for vector content
3PNG @2x: photos, complex illustrations that need raster
4PNG @3x: mobile apps where highest density is needed
5PDF: print materials onlySVG export cleanup after Figma:
Dev Mode Annotations:
Designers can add developer-specific annotations that appear only in Dev Mode:
Useful annotation content designers should add:
1Animation annotations:
2'Transition: background-color 150ms cubic-bezier(0,0,0.2,1) on hover'
3'Opens with translateY(-100%) → translateY(0), 250ms ease-out'
4
5Behavior annotations:
6'Closes on Escape key and click outside'
7'Sticky at top: 0 when scrolled past 64px'
8'Lazy loads images — use loading=lazy attribute'
9
10Breakpoint annotations:
11'Mobile: 1 column, no horizontal padding'
12'Tablet 768px+: 2 columns with 24px gap'
13'Desktop 1024px+: 3 columns'
14
15Content annotations:
16'Max 2 lines of text — use line-clamp: 2'
17'Course title: truncate at 60 characters'
18'Price shows as $0.00 when course is free'Dev Mode Code Comparison:
Extracting all CSS values for a Notification Toast component from Figma Dev Mode and implementing it with all states.
1/* Figma Dev Mode extraction for Toast Notification component
2 Path: Components / Feedback / Toast / Success
3
4 Code tab output (cleaned up):
5
6 Container:
7 display: flex
8 flex-direction: row
9 align-items: flex-start
10 gap: 0.75rem
11 padding: 1rem
12 background: #ffffff (variable: --color-bg-surface)
13 border-radius: 0.5rem
14 box-shadow: 0 4px 16px rgb(0 0 0 / 0.12)
15 border-left: 3px solid #16a34a (variable: --color-success)
16 width: 22rem (352px)
17
18 Icon container:
19 width: 1.25rem (20px)
20 height: 1.25rem
21 color: #16a34a (variable: --color-success)
22 flex-shrink: 0
23
24 Content area:
25 display: flex
26 flex-direction: column
27 gap: 0.25rem
28 flex: 1
29
30 Title text:
31 font-family: Inter, sans-serif
32 font-size: 0.9375rem (15px)
33 font-weight: 600
34 line-height: 1.467
35 color: #111827 (variable: --color-text)
36
37 Message text:
38 font-family: Inter, sans-serif
39 font-size: 0.875rem (14px)
40 font-weight: 400
41 line-height: 1.5
42 color: #6b7280 (variable: --color-text-muted)
43
44 Close button:
45 width: 1.25rem (20px)
46 height: 1.25rem
47 color: #9ca3af (neutral-400)
48 background: none, no border
49 flex-shrink: 0
50
51 Annotation: 'Entry animation: slide in from right 300ms ease-out'
52 Annotation: 'Auto-dismiss after 5 seconds'
53 Annotation: 'Stacks vertically with 8px gap when multiple toasts'
54 Variants: Success (green), Error (red), Warning (amber), Info (blue)
55*/
56
57/* CSS Implementation from Dev Mode values */
58
59.toast {
60 display: flex;
61 flex-direction: row;
62 align-items: flex-start;
63 gap: 0.75rem;
64 padding: 1rem;
65 background-color: var(--color-bg-surface, #ffffff);
66 border-radius: 0.5rem;
67 box-shadow: 0 4px 16px rgb(0 0 0 / 0.12);
68 width: 22rem;
69 max-width: calc(100vw - 2rem); /* responsive on small screens */
70 border-left: 3px solid transparent; /* variant-colored via data attr */
71
72 /* Entry animation from annotation */
73 animation: toast-in 300ms cubic-bezier(0, 0, 0.2, 1) both;
74}
75
76@keyframes toast-in {
77 from { opacity: 0; transform: translateX(100%); }
78 to { opacity: 1; transform: translateX(0); }
79}
80
81/* Variant colors from Dev Mode variants */
82.toast[data-variant="success"] { border-left-color: var(--color-success, #16a34a); }
83.toast[data-variant="error"] { border-left-color: var(--color-danger, #dc2626); }
84.toast[data-variant="warning"] { border-left-color: var(--color-warning, #f59e0b); }
85.toast[data-variant="info"] { border-left-color: var(--color-action, #2563eb); }
86
87.toast__icon {
88 width: 1.25rem;
89 height: 1.25rem;
90 flex-shrink: 0;
91 margin-top: 0.0625rem; /* 1px optical alignment with title cap-height */
92}
93
94.toast[data-variant="success"] .toast__icon { color: var(--color-success, #16a34a); }
95.toast[data-variant="error"] .toast__icon { color: var(--color-danger, #dc2626); }
96.toast[data-variant="warning"] .toast__icon { color: var(--color-warning, #f59e0b); }
97.toast[data-variant="info"] .toast__icon { color: var(--color-action, #2563eb); }
98
99.toast__content {
100 display: flex;
101 flex-direction: column;
102 gap: 0.25rem;
103 flex: 1;
104}
105
106.toast__title {
107 font-family: 'Inter', system-ui, -apple-system, sans-serif;
108 font-size: 0.9375rem;
109 font-weight: 600;
110 line-height: 1.467;
111 color: var(--color-text, #111827);
112 margin: 0;
113}
114
115.toast__message {
116 font-family: 'Inter', system-ui, -apple-system, sans-serif;
117 font-size: 0.875rem;
118 font-weight: 400;
119 line-height: 1.5;
120 color: var(--color-text-muted, #6b7280);
121 margin: 0;
122}
123
124.toast__close {
125 width: 1.25rem;
126 height: 1.25rem;
127 flex-shrink: 0;
128 color: #9ca3af;
129 background: none;
130 border: none;
131 cursor: pointer;
132 padding: 0;
133 display: flex;
134 align-items: center;
135 justify-content: center;
136 border-radius: 0.25rem;
137 transition: color 150ms ease, background-color 150ms ease;
138}
139
140.toast__close:hover {
141 color: var(--color-text, #111827);
142 background-color: var(--color-bg-surface, #f9fafb);
143}
144
145.toast__close:focus-visible {
146 outline: 2px solid var(--color-action, #2563eb);
147 outline-offset: 1px;
148}
149
150/* Toast container: stacks with 8px gap (from annotation) */
151.toast-container {
152 position: fixed;
153 bottom: 1.5rem;
154 right: 1.5rem;
155 display: flex;
156 flex-direction: column;
157 gap: 0.5rem; /* 8px from annotation */
158 z-index: 9999;
159 pointer-events: none; /* container is not clickable */
160}
161
162.toast { pointer-events: auto; } /* individual toasts are clickable */Every CSS value in this implementation came from Figma Dev Mode: the gap, padding, border-radius, shadow, font metrics, and colors. The design variables (--color-success, --color-text, --color-text-muted) are used as CSS custom properties with fallback hex values. The 300ms cubic-bezier(0, 0, 0.2, 1) easing for the entry animation came from a Dev Mode annotation. The 8px gap between stacked toasts came from a separate annotation on the toast container. The 5-second auto-dismiss is JavaScript behavior — not CSS — noted in the annotation.
The next lesson covers Design Token Implementation — how to build a CSS custom property system that mirrors the Figma Variables structure, enabling automatic dark mode and theme switching from a single token update.
Your progress is saved in this browser, on this device only.