Troubleshoot Figma to Tailwind CSS: Spacing, Typography and Color

Author: Pablo Mayoral Published: 03/12/2026 Updated: 03/12/2026
Category: Product design →

Follow one property from the approved Figma layer to the rule in the loaded stylesheet and the value the browser uses. Hold the card state, text and width steady and fix the first mismatch.

Troubleshoot Figma to Tailwind CSS: Spacing, Typography and Color
Quick Answer

Follow one property from the approved Figma layer to the rule in the loaded stylesheet and the value the browser uses. Hold the card state, text and width steady and fix the first mismatch.

To troubleshoot inconsistent spacing, typography, and color values when exporting a Figma design to Tailwind CSS, compare one component across three places: the selected Figma layer, the class and rule you shipped, and the value the browser uses. Hold the card state, content, and viewport steady. Start with one failing property and trace it to the first place the value diverges. A missing utility, a competing rule, and a fallback font require different fixes even if the screenshots look equally wrong.

Use the fictional Alder equipment catalogue as a practice fixture. Its card contains an availability badge, a title, a short description, and a “View details” link. In the example the design calls for 24 px padding, a 12 px gap between the title block and badge, a 20 px title with a 28 px line height, and a text color of #334155 for an available item. The sample discrepancies below are deliberately planted. They give a designer and developer something they can reproduce and inspect together.

Record the intended card

Open the actual instance used in the handoff and select its outer frame, the row that owns the gap, the title layer, and the badge text in turn. Record the frame or layer path alongside each number. In Figma's guide to inspecting designs, the Inspect panel exposes properties such as layout, typography, styles and variables, subject to access. Measurements between objects also let you check whether the visible gap matches what you wrote down.

Alder card with callouts for the outer padding, inner gap, title metrics and status text color in the fictional fixture.
Alder card with callouts for the outer padding, inner gap, title metrics and status text color in the fictional fixture.

Capture the item title and badge state as text in the ticket. “Available” and “Reserved for pickup” can wrap differently in the same slot. Record the available width of the card itself and the browser viewport width as separate values. The sample uses a 360 px card inside a 1024 px viewport for its first check. That gives the developers enough information to reproduce a grid column without guessing which Figma frame or item you meant.

For a fresh fixture, take the measurements from the current approved instance and record its variant and variable mode. If an earlier export still points to a different instance, regenerate or update the handoff before changing the implementation. For a build that has already shipped, keep the current CSS and screenshot as evidence, together with the exact class on the affected node. The responsive Figma-to-Tailwind workflow covers how to specify the responsive behavior that this diagnostic exercise assumes.

Find which box owns the gap

The outer frame owns 24 px of padding. The title and badge row owns the 12 px gap. In the browser, select the element that wraps the two children and inspect layout and the box model. In this example the first failing run shows 24 px padding on the wrapper but a 16 px gap on the inner row. The Chrome DevTools CSS reference explains how to view the box model and use Styles and Computed during inspection.

The row switches from gap-4 at 16 px to gap-3 at 12 px with the same 24 px outer padding.
The row switches from gap-4 at 16 px to gap-3 at 12 px with the same 24 px outer padding.

Find the winning gap declaration before changing a class. The exercise uses the default Tailwind v4 spacing base, so the active declaration from gap-4 resolves to 16 px when the base is 4 px. For this row the intended value is gap-3, which resolves to 12 px in the same conditions. The Tailwind theme documentation explains how spacing utilities use the spacing variable. Check your project's computed values because a custom base or root font size can change the pixel result. Keep the outer padding at its approved value.

If the gap already computes to 12 px, measure the child boxes and look for other space. A heading margin, distribution with justify-between, or a label that wraps to another line can make the distance between glyphs look larger. Flex gap is space between flex items, and neither the glyph edge nor the edge of a surrounding image necessarily coincides with the edge of an item. Use the same edges in both measurements and record any spacing the content itself contributes.

Check the font that rendered

Inspect the title layer's family, weight, size, line height, and tracking. Figma's text properties reference explains the controls and the CSS pixel values exposed in Dev Mode. For the Alder fixture the title uses Inter at 600, 20 px with a 28 px line height. Put the same title on both sides, including the same number of words and capitalization, before comparing the line break.

EmviUI Inter typography specimen with columns of different weights and descending text sizes.
Use the specimen to identify the intended size and weight in Figma, then check the rendered face in the browser.
The expected Inter face and a fallback can share 20 px type and a 28 px line height. Inspect the font details separately.
The expected Inter face and a fallback can share 20 px type and a 28 px line height. Inspect the font details separately.

In DevTools, start with the actual title element. In the exercise, Computed shows 20 px and 28 px, and the CSS family list starts with Inter. The Rendered Fonts details can still reveal a fallback. Check whether the required face is available and whether the app requested the right weight. Review the stylesheet's font-face declarations and the font request in Network if the browser did not select the expected face. Retest after a reload and keep the same text and width. A repair to the font asset or its family mapping can change line breaks while leaving both numeric measurements unchanged.

If size and line height also differ, compare the winning declarations independently. A font-size utility may specify a default line height through the theme, while an explicit leading utility or a different rule can alter that property. Trace the title size and its line height to the active declarations alongside the loaded font. The EmviUI guide to type size and reflow gives additional cases for testing narrow and enlarged text.

Trace the badge color

The exercise's badge reads Available. In the broken implementation the element has text-stock-available in its class list, but there is no corresponding rule in the loaded CSS. This can happen when an export builds the class by appending a status to a partial string. Tailwind detects tokens in source text and needs complete utility names in the scanned sources. Map the supported status values to complete strings in a scanned file and check the rebuilt stylesheet. A full class in the DOM proves the JavaScript emitted it. The stylesheet is separate evidence.

The available status has a class in HTML and no loaded rule. A complete class in the scanned code makes the rule detectable.
The available status has a class in HTML and no loaded rule. A complete class in the scanned code makes the rule detectable.

If the utility exists, inspect which declaration actually supplies color. A crossed-out declaration sends you to the winning rule. An active declaration that uses a variable sends you to that variable on the element and its ancestors. For Alder, the intended color role is --stock-available, with #334155 assigned in the active theme. A Tailwind v4 theme variable can expose that role as text-stock-available. The Tailwind examples for referencing variables show how the inline option emits the referenced value directly in the utility, which matters when a variable is defined on a descendant of the root.

Keep the label visible during comparison. The color check concerns the label's foreground and the actual surface behind it. If two modes use different values by design, compare the intended pair separately in each mode. If the badge still says Available after you switch the code fixture to Reserved, correct the state mapping before treating the color as a CSS regression.

Use an EmviUI card as a second specimen

The EmviUI Card catalogue provides a separate Figma specimen for the same inspection. The horizontal example places media beside a content column containing badges, a title, supporting text and an action. Those distinct layers let you practice identifying which element owns each measurement and choosing a single target for a browser comparison.

Horizontal EmviUI card with a green image on the left and badges, a title, text and a button on the right.
In this EmviUI specimen the spacing around the badges and title belongs to the content column.

Try the title first. In the EmviUI Figma asset, record the text settings of that particular layer and the space from the badges to the title box. In your own implementation identify the node that sets the typography and the parent that creates the vertical spacing. Keep the title constant during the first test, then try a longer title at the smallest supported width. If the larger EmviUI typography specimen prompts you to consider a different style, log that as a design decision with its own acceptance criteria.

Use the kit as a design reference and your browser as the record of your implementation. The diagram and repair values in this article belong to the invented Alder card. The horizontal EmviUI example supplies a second composition to inspect. Your team determines how to translate the selected Figma instance into classes, load the font, and wire the status to production data.

Repeat the check at delivery widths

Run the repaired card in its real layout, starting with the 1024 px viewport and the measured 360 px card. Reduce the viewport to just below and just above any breakpoint involved in the disputed property. Tailwind's responsive design documentation explains that ordinary breakpoint variants are mobile-first and shows the separate syntax for container queries. If changing the viewport fails to reproduce a container-query defect, change the relevant container width and record both measurements.

Repeat the badge test with the longer label and the title with a phrase that needs two lines. On the delivery page, check the equivalent of a 320 CSS px viewport or the corresponding zoom setup described in WCAG reflow guidance. For this ordinary card, look for a usable action, visible information, and no need to scroll horizontally to read the content. Revise any clipping rule that hides information the user needs.

Close the ticket with the Figma layer or style, the property and its expected value, the rule that won before and after the patch, and one observed result from the production build at each tested width. If the defect only appears with a second theme, include that theme on the same record. For this case the proof is a 12 px gap on the row, the intended face and line box on the title, and the status color resolved from the correct theme without changing the state label. The evidence tells the next reviewer which of the three fixes to revisit when any symptom returns.

Keep a clean reference case next to the repaired case for future review. Duplicate one catalogue item in test data and assign it a different availability. If correcting the Reserved item also turns the Available label into the reserved color, the patch is affecting a shared selector or variable outside its intended scope. If both cards remain legible but one now fills more height, decide whether the grid should tolerate that variation. Put any equal-height requirement in the results so it can be reviewed as a layout decision.

Run the comparison again on a build that uses the same source discovery and stylesheets as delivery. A development preview might contain another example that mentions the full class name and inadvertently supplies the missing CSS. In that case the badge looks correct in preview but fails when that source is absent from the shipping build. Verify the rule in the actual bundle served with the catalogue route, record what supplied it, and rerun after removing the preview-only dependency.

TargetDiscrepancy to reproduceExpected evidence
Inner row16 px gap with 24 px padding on outer frame12 px gap on the row, 24 px padding on the outer frame
TitleFallback despite 20 px size and 28 px line heightInter rendered at weight 600 with the same metrics
Status labelClass in HTML, rule absent from loaded CSSRule present, color #334155 in Available fixture
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.

Frequently asked questions

Which Figma number should I compare with CSS gap? ▼
Use the separation controlled by the parent row, measured between the item boxes. Inspect outer padding independently. Margins and distributed free space can alter the visual distance without changing CSS gap.
Does gap-3 always mean 12 px? ▼
It means 12 px in the exercise because the spacing unit resolves to 4 px. A customized spacing variable or a different root font size can change the result. Inspect the active rule and computed gap in the browser.
Why does the title wrap differently at the same font size? ▼
Check the rendered font, weight, tracking, actual content width and the exact text. A fallback font may have different glyph widths even when the computed font size and line height match.
Why does a Tailwind class appear in HTML but do nothing? ▼
Check whether the CSS rule exists in the stylesheet loaded on that route. Tailwind scans source text, so a class assembled from fragments may be absent from the compiled CSS. Use complete names in a scanned source. If the rule exists, check the cascade.
Where should I check the value of a color variable? ▼
Start on the element that uses the color and inspect the active theme ancestors. Verify the winning declaration and the variable it resolves. For two themes, run the same state and surface check in both.
What should a CSS handoff fix show at narrow widths? ▼
Show the real card with a long title and a longer status label. At the relevant breakpoint and at the WCAG reflow size, confirm the label, body and action remain available without horizontal scrolling to read the card.

Related articles