How to Create Color Variables in Figma for Status Badges
Create color variables in Figma for badge text and surfaces, check the exact contrast ratio, and test that repeated status labels update.
Create two local color variables, bind the text and surface separately, and test ordinary text for at least 4.5:1 contrast. Keep visible status wording and verify that both bound copies update.
To create color variables in Figma, open the variables table in a design file you can edit, add a variable of type Color, and enter a name and a value. Select the layer that should use it, open the variable picker from Fill or Stroke, and choose the saved variable. For a status badge, create one variable for the text and another for the surface, then measure the contrast between the two resolved values. Keep a plain-language status label visible even when the surface color is removed.
This walkthrough uses a sample equipment inspection queue for a fictional team called Rill. The row for pump P-104 reads “Due today.” We will go from two hard-coded fills to two named variables, fix a low-contrast candidate, and use a temporary edit to catch an unbound layer. The example uses one file and one appearance. You can paste the same values into a scratch file and compare the results with your own badge.
Define the status before the palette
Decide what the badge tells the person scanning the queue. In this example, “Due today” means an inspection has a deadline on the current calendar day. “Overdue” means the deadline has passed under the queue’s date rules. Keep the actual due date in the row so the person can check the label against the underlying information. Place the scheduling action in its own control so the badge can stay a plain status label.

Put two rows beside each other at the actual table width. Use “Due today” in one and “Overdue” in the other, with equipment IDs of the same length. Make a neutral copy where both pills have dark text and a white background. Ask someone to find the overdue item from the labels. If that distinction is unclear in the neutral copy, change the wording before assigning colors. For example, “Attention” conceals whether the staff member has time to act.
This is a way to test WCAG’s use-of-color criterion in a design review. The criterion requires another visual means of communicating information conveyed by color. Readable words meet the need for a second cue in this design. An icon can stay as a redundant cue if a reviewer can identify the state from the visible wording alone. Keep the exercise focused on two rows so a reviewer can explain exactly which cue they relied on.
Agree on where the state comes from before duplicating the badge through the file. The data decides whether a record is due today, and the badge displays that decision. An amber swatch is a presentation choice. A designer can replace it without rewriting the deadline rule. Conversely, if the team changes what “Overdue” means, update the label or surrounding explanation and rerun the neutral-copy check.
Create and bind two color variables
Open a scratch design file with edit access. Click the empty canvas to deselect layers, then open Variables from the design sidebar. In the local collection, choose Create variable and select Color. Name the first row status/due-today/text and enter #92400E. Create status/due-today/surface with #FFF7ED. Enter both as opaque colors in the sample. Figma’s guide to creating and managing variables documents the variable table, the name and value cells, and the settings available for each row.

Select the text layer inside the badge and apply status/due-today/text through the variable picker next to Fill. Then select the badge container and bind status/due-today/surface to its Fill. Confirm each binding by selecting the individual layer and reading the applied name. A selected parent can show a different fill than the label inside it. Figma’s guide to applying variables describes the picker for solid fills and strokes.
Use the saved name each time the same role occurs. If you type #92400E in a second label by hand, the two labels may look identical today and diverge on the first update. Likewise, picking the surface variable for the text layer can make the label vanish against an identical background. Give each variable a short description that includes its intended pairing. For instance, the text role says it should be used for small “Due today” labels on status/due-today/surface.
If the picker offers too many similar colors, edit the variable’s scope. Text fill is the useful option for the text role here. For the surface role, choose the fill scope that matches the actual container layer, such as Frame fill for a frame. If a valid variable disappears from the picker, confirm the selected layer, property and scope before making another variable. For an existing library with paint styles, review the guide to variables and styles before changing how shared treatments are applied.
Use EmviUI as a palette reference
Open the EmviUI color system to see how its base palette and named theme colors are presented. The accompanying EmviUI screenshot illustrates a color selection in Figma through the Libraries tab for a selected object. Use it to orient yourself when inspecting a kit asset and checking which fill it uses. The values in the Rill exercise are example values for a specific pairing.


In a copy of a design that uses the kit, pick one neutral row or compact status label as the place to try your own pair. Inspect its container and text separately. If the file contains a shared color treatment with a valid stroke, preserve the stroke while you test a new text or surface fill. Keep the original kit asset available for comparison so the trial can be reversed without affecting colleagues’ files.
A base palette lets you look for colors with the appropriate level of emphasis. A role name tells the next designer where the selected color belongs. Two roles can happen to resolve to the same amber today. For example, an amber deadline label and a warning that data could be lost have different meanings and may diverge later. Keep their intended usage and pairing explicit even when the values coincide.
For a first local trial, two direct color values are enough. When a team already has approved base colors, Figma supports creating an alias by choosing another variable for the value in the variables modal. Use that capability when the team intends the role to follow the base variable. Record which relationships are deliberate. For example, an inspection state may need to stay stable when marketing changes the brand accent. That is a reason to review dependencies before pointing a status role at the accent.
Measure the real text and surface
Measure the small label against the exact surface on which it appears. According to the W3C’s minimum text contrast guidance, ordinary text needs a ratio of at least 4.5:1 for WCAG AA. The exception for sufficiently large text uses 3:1. The small label in this example is ordinary text, even when it is semibold. Use the sRGB relative-luminance formula from the standard and retain the unrounded result when judging a pair near the threshold.

The candidate #F59E0B on #FFF7ED yields about 2.02:1. Changing only the text to #92400E yields about 6.68:1. The underlying surface and status wording remain the same, which makes the effect of this one change easy to inspect. These calculations are for opaque sRGB colors with no overlay. If the design makes either layer translucent, measure the effective rendered colors against each intended background. That may include a hovered row as well as a plain row when the badge surface allows the underlying row to show through.
If a small symbol is essential to understanding a different badge, assess its contrast against adjacent colors as part of the W3C guidance on non-text contrast. The 3:1 rule there applies to required visual information under that criterion. In the Rill row the readable words carry the state, so the faint outer edge of the pill can remain decorative. Keep a separate check for an interactive filter chip if you reuse the silhouette. Its selected and focus indicators serve different purposes from the background of this passive label.
Write the two input hex values, the measured ratio, and the location of the sample next to the badge. That makes a design review reproducible. If the checked pair differs from what developers use, inspect the computed foreground and background on the implemented row. The Tailwind guide to colors for forms, focus and status continues that check in the browser.
Change one variable to verify reuse
Make a local review frame with three labels. In the first two, bind the text to status/due-today/text. In the third, deliberately paste the same starting hex as a literal. Give all three the same surface. Record the expected result before making an edit. When the saved text value changes from #92400E to #78350F, the first two should change and the literal should stay as entered. Verify the values or picker names in the sidebar since both browns can look similar.

If a bound label remains unchanged, check what the text layer actually uses. It might still be reading a paint style or a different variable with an identical original value. In a file with multiple collections, search by the full name and confirm the collection. Inspect repeated instances where the same component was customized. Where the intended text role is missing, reapply it and run the change again. Restore #92400E after the check and remove the literal control sample from the deliverable.
The edit checks propagation and helps find one class of binding error. Repeat the contrast check after the final choice and revisit each surface where the badge is used. If a row loses the visible wording at a compact width, adjust the layout or supply a short status label with the same meaning. Validate the real text and its background where users will encounter it, including any view that renders the badge outside the original queue.
For handoff, include the two variable names, their current resolved values, a screenshot of the label in context, and what the deadline state means. Include the failing pair in the review notes so future changes can be checked against a concrete example. If a web token already exists, record its mapping in the implementation task and confirm it with the person who owns that code. Figma’s code syntax field can provide a name in inspection snippets. The runtime still needs the actual CSS declaration and a browser test.
Close the task when another designer can select either layer and identify the correct variable, and someone reviewing the implemented row can read the deadline state without relying on amber. Keep one review frame with the default row, a narrow row and the neutral copy so future color changes can be checked in context.
For a review with real dates, give the developer two fixed fixtures, one that falls on the active day and another just before it. Have the product owner specify which time zone defines the day. Keep the fixtures independent of the current time so a screenshot or automated UI check can be repeated tomorrow. A changing clock can otherwise shift the label during review and make a data issue look like a color regression. Compare the rendered words first, then inspect the foreground and surface. Those two observations identify which owner should investigate a mismatch.
- Create and bind a text and a surface variable.
- Measure the resolved text against the badge fill.
- Change one variable, confirm both copies update and restore the approved value.
Pablo Mayoral
Senior UX/UI & Web Designer with 10+ years of experience. Creator of EmviUI (10k+ components Figma design system), UImand, and Vitamin Bootstrap. Currently designing digital products at CQMRewards.