Skip to content
Dynamic Variables

Dynamic Variables

by Neil Akhmetov

Variables that compute themselves: write a formula once, and colors, spacing and type stay in sync!

PaidFigma

Installs

631

Likes

144

Users

1,926

Views

10,163

Preview

Dynamic Variables preview

About this plugin

Change one base variable โ€” every dependent color, spacing and type value updates itself.

Dynamic Variables lets your Figma variables derive from each other: write a small JavaScript formula in a variable's description field, and the plugin keeps its value in sync with everything it depends on.

๐ŸŽจ primary-600: {{ cd($base-color).darken(0.1) }} โ€” correct today, correct after every rebrand.

You know the ritual: the brand color shifts, and now it's 20 shades ร— light-and-dark modes of hand edits โ€” and the one shade you miss is the one that ships. Type scale tweak? Same ritual. Spacing rhythm? Same. Your tokens already depend on each other โ€” Figma just doesn't know it yet. This plugin is how you tell it.

๐Ÿ› Try it before installing: the documentation runs every example live in your browser โ€” editable variables, editable expressions, visual previews. Two minutes there and you'll know if this is for you.

โœจ NEW in 2.0 โ€” you don't even have to write the formulas:

๐Ÿค– AI-assisted editing: click Copy Brief for AI, paste it into ChatGPT, Claude, Gemini โ€” whatever assistant you already use โ€” describe what you want in plain words, then paste the reply back. The plugin parses it and shows a preview of every change before anything touches your variables โ€” it can update expressions and even create the variables it needs. Or hand the brief straight to the Figma Agent, which edits your variables directly. No API key, no extra subscription.

๐Ÿ–ฅ๏ธ Visual editor: browse collections as a tree and edit expressions in a real code editor (Monaco โ€” the engine inside VS Code) with syntax highlighting, autocomplete for your variable names, and inline errors, instead of squinting at description fields.

๐Ÿงฉ Global Functions: define a helper once โ€” say, a function that picks readable text for any background โ€” and call it from any expression. Repeated logic lives in one place.

๐Ÿ—‚๏ธ Relative paths, on by default: $('./Base') reads a sibling, $('../radius') reads one group up โ€” so one generic expression serves a whole family of tokens and survives renames of the family itself.

๐Ÿƒ Motion variables: Figma's new Timing & Easing types are supported โ€” switch easing curves by condition (reduced motion, brand, platform) via alias selection, and export any curve as CSS with cssEasing().

๐Ÿ”‘ How it works:

โš™๏ธ Expressions: any JavaScript between {{ }} in a variable's description. Reference siblings as $A, other collections as $('Collection/Variable'). A variable C defined as {{ $A + $B }} updates whenever A or B changes.

๐ŸŽจ Color science built in: colord (cd) and culori (cl, cv): {{ cd($color).lighten(0.2) }}, WCAG luminance {{ cl.wcagLuminance($brand) }}, OKLCH with gamut clamping {{ cl.clampRgb(cv("oklch(90% 0.4 135)")) }}, plus Figma-style {{ rgba("green") }}.๐Ÿง  Mode-aware logic: one expression, different behavior per mode โ€” {{ ($$().mode == "Mobile" ? 1 : 2) * $base-padding }}. Read a variable's own name, collection and modes through the $$() metadata object to write scale steps that compute themselves from their names.

๐Ÿ•’ Two run modes: Start Monitoring Changes (live updates at your chosen interval, pause/resume anytime) or Update Once when you want full control.

๐Ÿ”— Rename-proof: references fix themselves when variables are renamed or moved.

๐Ÿ“š Library variables: bring team-library variables in as aliases and use them in expressions.

โŒ Honest errors: cyclic dependencies, unresolved references, type mismatches โ€” reported per variable, per mode, in the editor.

๐ŸŒ Live data: expressions can fetch. This works, today, in a variable: ๐Ÿ”ค nyc-feels-like: {{ fetch("https://api.open-meteo.com/v1/forecast?latitude=40.71&longitude=-74.01&current=apparent_temperature&temperature_unit=fahrenheit").then(r => r.json()).then(d => Math.round(d.current.apparent_temperature) + "ยฐF") }} โ€” the current feels-like temperature in New York, in your prototype. Same trick for prices, or just the time: {{ new Date().toLocaleTimeString("en-GB") }}.๐Ÿ’ก What people build with it:

๐ŸŽจ Full color ramps from one seed โ€” 50โ€ฆ950, light and dark, self-updating๐Ÿ“ Spacing systems: #๏ธโƒฃ spacing-s: {{ $base-spacing * 2 }}, density modes included๐Ÿ–‹๏ธ Type scales: #๏ธโƒฃ heading-md: {{ Math.round($heading-sm * 1.2) }}โš–๏ธ Accessible on-colors: pick black or white text by actual contrast math, per mode๐Ÿ”ค Composed strings: {{ "Hello, $user-name!" }} for copy that assembles itselfโบ๏ธ Conditional tokens, Material-style state layers, concentric radii โ€” if JavaScript can compute it, a variable can be it๐Ÿ’ณ Free & Pro: everything is free for up to 5 dynamic variables, forever โ€” enough to feel the click. Need more? A full-featured trial (7 or 14 days, depending on variant) has no cap. Pro removes the limit and funds development.

Buy Pro LicenseAfter purchase: Dynamic Variables โ†’ Pro License โ†’ Activate Key. Licenses cover 5 devices (10 on Unlimited). Reinstalling your OS? I can reset your activations โ€” just write me.

Subscribe for updates๐Ÿ”— Links:

๐Ÿ“– Interactive documentation โ€” live playgrounds, syntax, relative paths, $$() metadata, AI editing, recipes (and a small thank-you at the end for those who read it all)๐Ÿ’ฌ Feedback and use cases โ†’ comments below. I read everything, and roadmap items regularly come from here.

More design tools other plugins

View all