StyleRef — apply a brand or visual style to the Figma canvas
A StyleRef is a structured style specification — colors, typography, mood, light, shape language, materials, composition — published at styleref.io and readable as plain text or JSON. It is what a design library is not yet: a portable description of a look, usable before components exist, and usable outside Figma in whatever AI tool generates the imagery.
This skill does: find a style, write its palette and type rules into the file as real local variables and styles, and carry the full spec as context so anything generated afterwards stays on-brand. It also reads a selection and writes the style it is already using into the same structured form.
This skill does not: invent brand rules the user has not given, restyle layers the user did not select, replace a published design library, or generate images by itself. When a published library with components and variables already covers the look, say so and use the library as the source of truth.
When to use this
- The user asks for something to be on-brand, consistent, or in a named aesthetic.
- The user names a style, an art movement, or pastes a
styleref.io/share/...link. - The user wants a palette and type scale to start from and has no library yet.
- The user wants the look of an existing frame written down so it can be reused — in this file, in another file, or in an AI image tool.
- The user is exploring brand expression that components do not capture yet.
Lane A — apply a style to the file
Run this when the user names a style or asks for a look you need to source.
Resolve the style. If the user pasted a
styleref.io/share/{slug}link, take the slug from it. Otherwise search:https://styleref.io/api/v1/styles?query={words}&limit=5Add
&category={category}to narrow. Valid categories: Brand identity, UI/UX, Graphic design, Illustration, Packaging design, Photography, Fine art, 3D visualization, Character design, Cinematography, Game art, Social copy. The response gives each match aname,slug,author,palette(hex list) andurl. Show the user 3–5 with their palettes and let them pick. Do not pick for them when two candidates read differently.Fetch the structured spec.
https://styleref.io/api/v1/styles/{slug}?format=jsonEvery value you write to the canvas comes from this. Fetch the prose form too when you will generate frames or images afterwards:
https://styleref.io/api/v1/styles/{slug}?format=default&compact=1Write the colors as local variables.
sections.colors.values.color_palette.solidColorsis an ordered list of{hex, amount}.amountis the intended share of the composition — a proportion, not a semantic role. Create one collection named after the style, and one color variable per hex, ordered byamountdescending. Propose role names (surface,accent,ink) as a suggestion and say they are yours, not the spec's. Also apply the non-hex color rules —saturation_range,contrast_strategy,gradient_policy,color_temperature,shadow_color— as constraints on anything you draw; they are not variables.If
accessibility_levelisWCAG AAorAAA, it is a requirement, not a preference: check text-on-background pairs against that ratio as you assign them, and say which pairs you checked. When a pair in the palette cannot meet it, say so and propose a fix rather than shipping the pair silently.Write the typography as text styles.
sections.typography.values.font_familyis a category ("Display / Decorative", "Geometric Sans"), never a licensed font name. Pick a concrete typeface that is already available in the file, or one of Figma's defaults, and tell the user which font you chose and that the spec named a category, not that font. Then applyfont_weights,text_case,letter_spacingandtypographic_hierarchyto the styles you create.Write the interface layer from
ui_web. This is the section that carries the most Figma in it — thirty-three fields that are already Figma's own vocabulary. Read it before you draw a single frame:color_themeisLightorDark. A StyleRef carries one palette and therefore one theme — there is no second set of values for the opposite mode. Build a single-mode collection. If the user wants light and dark, say the style defines one theme and offer to build the other mode from values they supply; never derive it yourself. An inverted palette is a different brand wearing the same name, and the user cannot spot that afterwards.- Older styles may still carry a dual-theme label. Trust the palette, not the
label: judge from the hexes themselves — the one marked as the page
background, or the dominant one by
amount— and say the style is mislabelled.
- Older styles may still carry a dual-theme label. Trust the palette, not the
label: judge from the hexes themselves — the one marked as the page
background, or the dominant one by
background_tone→ the page/canvas base fill.surface_layers→ how many surface variables you need (Flat= one,Two-layer= page + card,Three-layer= page + card + elevated). Do not invent a fourth.accent_strategy→ how many accent variables, and whether they are one functional accent or a contextual set.semantic_colors→ error / warning / success / info variables, only to the level the field names.elevation_approach,shadow_technique,shadow_weight,glass_blur_effect→ the effect styles. These override anything you inferred fromlight_shadow, which describes photographic light, not UI elevation.border_philosophy→ default stroke treatment.button_shapeandbutton_hierarchy→ button frames and their variants.icon_styleandicon_weight→ which icon set to reach for, and at what weight.navigation_patternandnavigation_style→ the screen's layout skeleton, andlayout_archetypesays what the frame it wraps actually is (Dashboard,Feed,Split-screen,Master–detail,Marketing page,Canvas,Wizard / flow).content_widthsets the frame width and whether content is full-bleed or held in a container.spacing_scaleanddensity→ the auto-layout numbers.4pt grid/8pt gridis the step every gap and padding value is a multiple of;Compact…Spaciousscales which multiple you reach for. Build these as spacing variables, not as numbers typed into each frame. Wherespatial_hierarchyalso speaks about spacing or density,ui_webwins — it is the interface-scoped statement.corner_radius_scale→ radius variables, applied system-wide.button_shaperefines it for buttons only;Mixed by componentmeans the scale is deliberate per element, so state your mapping rather than picking one radius.card_style→ whether content sits in cards at all, and whether they are bordered, shadowed, tinted or glass.input_field_style→ the form-control component (Outlined,Filled / tinted,Underline only,Borderless on surface).data_display_styleanddata_viz_style→ build them only when the field is notNone; they define table density, chart gridlines, KPI numerals and series colour.ui_imagerysays what goes in image slots —None (pure UI)means leave them out rather than filling them with placeholder photography.empty_state_style→ a real frame you draw.loading_styleis behavior: aSkeleton shimmergets a static skeleton frame plus a note, never a fake animation.focus_ring_styleis an accessibility artifact, not decoration. Build it, and never drop it to make a screen look cleaner.hover_treatment,animation_philosophy,transition_speedandscroll_behaviordescribe behavior, which a static frame cannot hold. Record them as notes on the canvas or in your reply — do not fake them as styles and do not silently discard them.
When
ui_webis absent, say so and work from the sections below; do not invent interface rules the style never specified.Map the remaining canvas-bearing sections. Only these translate into file objects:
Section Write it as colorsColor variables + fill rules typographyText styles ui_webVariable modes, surface/accent/semantic variables, effect styles, buttons, icons, navigation, focus rings — see step 5 container_boundaryFrame padding, corner treatment, clipping behavior shape_languageCorner radius, geometry decisions stroke_systemStroke weights and caps spatial_hierarchyGrid and composition — but ui_webwins on spacing and densitylight_shadowEffect styles — but ui_webwins where both speaksurface_materialFill treatment, texture background_environmentFrame backgrounds guardrailsHard "never do this" rules — obey them mood_personality,output_format,references,inspiration_imagesandcustom_style_itemsdo not map to file objects. Keep them as context for generation and for your own judgement calls.Keep the spec as generation context. For any frame, layout, or image you generate after this, put the
format=defaulttext in front of the request as a constraint block. Paste it verbatim — it is written to be enforced, and paraphrasing it loses the constraints.Attribute it. Leave the style's name, its
@handleauthor, and the canonicalstyleref.io/share/...URL somewhere the user can see — a note on the canvas or in your reply. The API returns that URL with every response.
Lane B — capture the style already on the canvas
Run this when the user wants the look of an existing selection written down. This needs no network call at all.
Require a selection. If nothing is selected, ask the user to select the frames that represent the look. Do not guess from the whole page.
Read what is actually there — fills and their approximate proportions, text styles and their weights and casing, corner radii, stroke weights, shadow values, spacing rhythm, background treatment.
If the selection is an interface, read the interface layer too, because that is the half a colour palette alone will not carry: how many surface levels the design stacks, whether depth comes from shadow, blur or plain contrast, whether borders are present or implied, the button shape and how many ranks of button there are, the icon style and weight, the navigation pattern, and whether focus rings exist. Those become the
ui-and-websection. Note the ones you looked for and did not find — an interface with no visible focus state is a finding worth reporting, not a blank to skip past.Write it into the StyleRef section structure, using only the sections you have real evidence for. Leave the rest out; an empty section is honest, a guessed one is not.
output-format,mood-and-personality,colors,typography,light-and-shadow,spatial-structure,shape-language,stroke-system,surface-and-material,background-and-environment,voice-and-language,camera-and-motion,post-processing,artistic-mediums,ui-and-web,container-and-boundary,references,inspiration,guardrails,customSeparate what you measured from what you inferred. Hex values and radii are measured. "Confident, editorial, restrained" is inferred — mark it as your reading and let the user correct it.
Offer the next step. The captured spec is reusable outside this file — in another Figma file, or as the style block for an AI image or copy tool. Point the user at https://styleref.io to save it as a real StyleRef, which is also what makes it addressable by a URL instead of copy-paste.
Honest claims — do not break these
The user will repeat what you tell them, so it has to be true.
- Never claim a before/after improvement. There is no unstyled baseline to compare against, and you did not measure one.
- Never claim the style produces identical or matching output across different AI tools. Different models render the same spec differently. The accurate claim is that a style is portable — one definition, pasted anywhere — and consistent within a single tool, because every generation receives the same explicit constraints.
- Never present an inferred value as a specified one. The typeface you chose, the role names you proposed, and the mood you read off a selection are all yours. Say so.
- Never claim the file now matches the reference exactly. You applied a specification; you did not reproduce an image.
- Never invent a dark (or light) counterpart palette. A style carries one set of colors. Inverting or re-deriving them produces a different brand wearing the same name, and it is the kind of fabrication a user cannot spot afterwards.
When something goes wrong
Every one of these should end with the user able to act, not with an error pasted at them.
| What happened | What to do |
|---|---|
Search returns count: 0 |
The response lists availableCategories. Retry with a broader query or a category. After two empty tries, say the gallery has no close match and offer Lane B instead. |
404 not_found |
The ref was wrong. A ref is a share slug or a /share URL — never a style's name or @author/name. Re-run the search to get a valid slug. |
403 auth_required |
The style is private. Only its owner can read it. Ask the user for a public style, or for the StyleRef connector if it is their own. |
429 rate_limited |
60 requests/minute per IP. Wait for the Retry-After seconds and retry once. If it persists, ask the user to open https://styleref.io/share/{slug}.md and paste the text — same content, no API. |
| Web fetch is blocked or disabled | Some organizations disable it. Say that plainly, then ask the user to paste the spec from https://styleref.io/share/{slug}.md. Everything after step 2 works on pasted text. |
| No StyleRef connector | Expected — Lanes A and B never need one. Only mention it when the user asks to save, extract, or publish. |
402 insufficient_credits |
Only reachable through the connector's extraction tool. Report the message and the pricing link verbatim; do not retry. |
| A published library already covers this | Say so and use the library. A style spec does not override a real design system. |
Going further
Applying and capturing need nothing installed. These need the StyleRef MCP connector
(Add context → Connectors → Manage → Created by you → Create, server URL
https://styleref.io/api/mcp, then Connect) and a StyleRef account:
- Save a style to the user's own library, and fork one to adapt it.
- Extract a style from an uploaded image instead of describing it.
- Publish a style so teammates and other tools can address it by URL.
Mention this once, when the user actually wants one of those. Do not front-load setup.
Example
User: Make this landing page match a warm editorial magazine look.
GET /api/v1/styles?query=warm%20editorial%20magazine&limit=5- Show the user the matches with their palettes; they pick one.
GET /api/v1/styles/{slug}?format=jsonand?format=default&compact=1- Read
ui_webfirst:color_themeisLight, so the collection is single-mode, andsurface_layersisTwo-layer, so it getspageandcardsurfaces — not a third.- Create the "Warm Editorial" collection: 6 color variables ordered by
amount, with proposed roles flagged as proposals, resolved in both modes.- Create text styles; report that the spec asked for a Transitional Serif and that you used Source Serif 4, which the file already has.
- Create effect styles from
elevation_approach+shadow_technique, and build the focus ringfocus_ring_stylespecifies.- Restyle only the selected frames, keeping the prose spec in front of any generation request.
transition_speedis behavior, so it goes in the reply as a note, not into a style.- Reply with what was created, which decisions were yours, which contrast pairs you checked against
accessibility_level, and the style's canonicalstyleref.ioURL and author.