惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
M
MIT News - Artificial intelligence
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
NISL@THU
NISL@THU
P
Proofpoint News Feed
Microsoft Security Blog
Microsoft Security Blog
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
G
GRAHAM CLULEY
The Register - Security
The Register - Security
S
SegmentFault 最新的问题
I
Intezer
Know Your Adversary
Know Your Adversary
T
Threatpost
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
Security Latest
Security Latest
量子位
S
Securelist
Recorded Future
Recorded Future
V2EX - 技术
V2EX - 技术
Application and Cybersecurity Blog
Application and Cybersecurity Blog
阮一峰的网络日志
阮一峰的网络日志
雷峰网
雷峰网
P
Privacy International News Feed
AI
AI
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
博客园_首页
IT之家
IT之家
S
Security @ Cisco Blogs
Google DeepMind News
Google DeepMind News
Help Net Security
Help Net Security
C
CERT Recently Published Vulnerability Notes
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The GitHub Blog
The GitHub Blog
美团技术团队
L
LangChain Blog
F
Fortinet All Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Security Affairs
Cloudbric
Cloudbric
O
OpenAI News
PCI Perspectives
PCI Perspectives
J
Java Code Geeks
P
Privacy & Cybersecurity Law Blog
B
Blog RSS Feed
MyScale Blog
MyScale Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
From Figma to Tailwind Without Writing a Single px — A Real Automation Case in Production
Giovanni Lim · 2026-04-28 · via DEV Community

From Figma to Tailwind Without Writing a Single px — A Real Automation Case in Production

"The design is ready. Now just grab the values and drop them into the code."
Every front-end developer has heard that line. And every front-end developer knows it lies.

Behind that "just", there's a silent workload: opening Figma, inspecting frame by frame, transcribing padding values, font sizes, background colors, spacing — and repeating that for every state variation of the component. Mobile open. Mobile closed. Desktop open. Desktop closed. And hoping you don't mistype a single px along the way.

That's exactly the work we automated on a themed banner in production. And the process taught me more about the limits of Figma — and what AI actually means in this context — than any documentation ever could.

The Tool That Made It All Possible

Before getting into the architecture, it's worth setting the context that gave rise to all of this.

The company made a direct bet on AI adoption across its teams — not as a trend to be observed from a distance, but as a concrete investment in accelerating, streamlining, and improving the work of those on the front lines. That encouragement has been essential, and it's being put to very good use.
It was within that context that Claude Code proved to be an excellent fit.

Claude Code is an AI agent developed by Anthropic that operates directly in the terminal, with access to the file system, the project's codebase, and external tools via MCP. It's not an assistant that answers questions — it acts. It reads files, understands codebase context, makes decisions, and executes changes.

It was inside Claude Code that the skill was created, the flow was designed, and the mutations to the project files happened. Without the ability to act directly on code — and not just suggest — the automation I'm about to describe simply wouldn't exist in the form it does.

The Architecture That Made Automation Possible

Before talking about what the AI did, I need to talk about what was already in place.

The themed banner follows a simple and deliberate architecture: each theme is identified by a mnemonic — a unique key received via API that determines which banner should be displayed. From that mnemonic, the system loads the corresponding .tsx file, which holds the full component structure. That component, in turn, consumes a separate .ts file — responsible exclusively for Tailwind styles, organized by state variation.

And here it's worth pausing to understand what that styles file actually controls — because it goes well beyond color and typography.

The banner is a living component. It exists in four distinct states: mobile closed, mobile open, desktop closed, and desktop open. In each of those states, practically everything can change. Font sizes and weights vary. The logo scales accordingly. But what makes the system genuinely complex is that the spacing between every element also recalculates — the gap between logo and title, the internal container padding, the vertical distribution of elements when the banner is expanded.

There's no fixed layout that simply "stretches" from mobile to desktop. Each state has its own spatial distribution logic, explicitly defined in the .ts file. One object for mobile closed, another for mobile open, another for desktop — each one describing not just appearance, but composition.

That separation between structure (.tsx) and style (.ts) wasn't designed with automation in mind. It was designed for readability and maintainability. But it created something valuable: a clear target. An exact place where any design data needed to land.
Without that structure, the automation would have had no path to follow — making the whole task far more costly.

How the Figma Integration Works in Practice

To connect Figma to this flow, a dedicated skill was developed — a structured instruction that the AI agent recognizes and executes as a coherent sequence of steps.
The command is simple and straightforward:

/figma-to-tailwind-banner {mnemonic} {figma_link}

With those two parameters, the agent already knows everything it needs: which .ts file to update (via mnemonic) and where to pull the design data from (via the Figma link). The banner images are already in the project — the skill doesn't need to deal with assets, only styles.

This approach turns what would otherwise be an ad hoc process into something repeatable and predictable. Any new themed banner that follows the same architecture can be styled with the same command, with no adaptation required. The mnemonic changes. The Figma link changes. The process stays the same.

What Figma Delivers — and What It Hides

The Figma integration happens via MCP (Model Context Protocol), which allows the AI agent to connect directly to Figma as if it were a collaborator — not just consuming an API, but navigating the design structure contextually.

The first step is always get_metadata: the agent discovers which frames exist, how they're named, and what the hierarchy looks like. From there, get_design_context extracts the styles for each variation.

What Figma delivers well: frame structure and layer hierarchy, spacing, paddings and margins, font sizes, weights, line-heights, and the widths and heights of individual elements. For a component that varies as much as this banner, that data is the heart of the extraction — every gap, every internal padding, every logo size per state is there, accessible and structured.

What Figma hides:
When a frame's background is an image or a vector — as was the case with this themed banner, which uses an illustration as its backdrop — Figma doesn't expose the color. There's no #hexcode value available. The design is there visually, but programmatically, there's no data.

The automation had to infer. Based on the available context — the component state, the banner theme, the colors already known to the Tailwind config — the agent made a fallback decision. It didn't invent a random value, but it also didn't stall: it made a reasoned, explicit choice that the developer would review afterward.

Another limitation: the states exist in Figma, but the logic of how they combine lives in the code. The design shows the open and closed banner separately. But who decides that "mobile closed is the base and desktop uses the md: prefix" is the project's convention — not Figma. The automation had to understand that by reading the React code, not the design.

The Flow Under the Hood

Simplified, the automation runs five steps in sequence:

  1. Discovery — get_metadata maps the available frames and identifies the four relevant variations.

  2. Extraction — get_design_context pulls the styles for each variation: spacing between elements, typography, logo sizes, and container dimensions — everything that changes between states.

  3. Validation — before generating any class, the agent cross-references the values against the project's tailwind.config.ts. Classes that don't exist in the config can be purged in production — so known tokens take priority over raw values.

  4. Mobile-first merge — the four variations are merged into a single object: mobile as the base, desktop with the md: prefix. The agent applies the project's convention, not a generic one.

  5. Direct mutation — the .ts file is updated. Only the class strings are replaced. No component logic is touched.
    Not a single visual value was written manually. No px, no color, no font-size, no gap.

What Still Requires a Developer's Eye

The automation delivers a reviewed starting point — not a final deliverable. A few things that always require human attention:

The color fallback. When Figma doesn't provide the data, the inference needs to be validated visually.
The agent flags when this happens, but the final call belongs to the developer.

The closed banner height. This property lives in an inline style on the React component — not in Tailwind. The automation knows the height exists, but can't generate it via classes. It's a conscious architectural constraint, not a flaw.

Decisions that look visual but are architectural. The logo's positioning within the banner, for example, involves choices that depend on product context — not just what Figma shows. The spatial distribution between elements can be correct in absolute values and still need adjustment once real content is inserted. In those cases, the agent flags the question and waits for a human decision.

Automation as an Accelerator, Not a Replacement

What this experience made clear is that the AI worked well here because the environment was ready to receive it. The clear separation between .tsx and .ts, the mnemonic as a unique identifier, the explicit organization of styles by state, the consistent naming of frames in Figma — all of that created the conditions for the agent to have enough context to act with precision.

And the real complexity of the component — four states, independent spacing, logo and typography that adapt together — is exactly what makes the automation most valuable. The more manual variations a process requires, the higher the risk of inconsistency. And the greater the gain from eliminating it.

The automation eliminated the mechanical work. The work that requires judgment — visual review, edge case validation, architectural decisions — remains with the developer.

And perhaps that's exactly how it should be.

This case is part of an ongoing effort to integrate AI tools into the real front-end development workflow — not as a replacement for the process, but as part of it.