सीधे content पर जाएँ

CSS variables to Figma variables

CSS variables से Figma variables, आपके code वाले नामों से

किसी भी URL से CSS variables को Figma variables में बदलें: --brand-primary बनता है brand/primary, मिलती values पर text व shadow styles reuse होती हैं।

  • --brand-primary, Colors · <domain> collection में brand/primary बनकर आता है
  • 96 तक color variables, 48 text styles और sm/md/lg/xl shadow styles
  • Values मिलें तो आपकी file के variables और styles दोबारा इस्तेमाल होते हैं
  • वही site दो बार import करें, कुछ भी नया नहीं बनता

EUREKA! · · 5 मिनट का लेख

CSS variables से Figma variables, आपके code वाले नामों से

CSS variables को Figma variables में बदलना आम तौर पर हाथ का काम है: आप site import करते हैं और सैकड़ों layers मिलती हैं जिनमें hex values hard-coded हैं, कोई भी linked नहीं। HTML to Frames यह import के समय ही कर देता है, इसलिए जो colors site code में define करती है, वे आपकी file में असली Figma variables बनकर आते हैं, उन्हीं नामों से जो उसके developers ने रखे थे। Brand blue बदलने के लिए अब हर frame खंगालना नहीं पड़ता।

Styles & variables चालू होने पर HTML to Frames पेज की CSS custom properties और असल में इस्तेमाल हुए colors पढ़ता है, एक color variable collection के साथ text और shadow styles बनाता है, और import हुई layers को उनसे bind करता है। आपको ऐसा पेज मिलता है जिसे layer by layer की बजाय Variables panel से restyle किया जा सकता है।

Styles & variables क्या करता है

एक option, तीन तरह का design system output:

  • Color variables. पेज पर कम से कम दो बार इस्तेमाल हुए colors, और site की किसी CSS custom property से मेल खाते colors, variables बनते हैं। हर import में 96 तक, Colors · <domain> नाम की collection में।
  • Text styles. कम से कम दो बार इस्तेमाल हुई, या 20 px और उससे बड़ी typography settings, text styles बनती हैं। हर import में 48 तक।
  • Shadow styles. दोहराई गई shadows size के हिसाब से नाम वाली effect styles बनती हैं: sm, md, lg और xl।

Import हुई layers के fills, strokes और text colors उन variables से bind होते हैं, और text layers नई text styles इस्तेमाल करती हैं। Layers panel अब भी पेज जैसा दिखता है; फ़र्क यह है कि अब वह tokens की ओर इशारा करता है।

CSS variables से Figma variables: Auto Layout, color variables, text styles और components के साथ import हुआ पेज
Variables और styles लगे हुए import का result

नाम code से आते हैं

जब site अपना palette CSS में define करती है, तो वही नाम इस्तेमाल होते हैं:

CSS custom propertyFigma variable
--brand-primarybrand/primary
--gray-900gray/900
--wp--preset--color--accent (WordPress)wp/accent

हर token में साझा prefix (जैसे किसी library का namespace) हटा दिया जाता है, ताकि नाम छोटे रहें। जिन colors की कोई custom property नहीं है, उन्हें blue/500 या neutral/900 जैसा वर्णनात्मक नाम मिलता है। Text styles <domain>/Heading|Body|Small/<size>/<line height> <weight> pattern पर चलती हैं, जैसे example.com/Heading/48/56 Bold, और shadows <domain>/Shadow/md बनती हैं।

यह कैसे काम करता है

  1. Capture. पेज एक असली browser में render होता है। Layers के साथ capture service :root पर declare हुए color tokens भी भेजती है।
  2. Usage गिनना. पेज के हर fill, stroke और text color की गिनती होती है। दो या ज़्यादा बार इस्तेमाल हुए colors, और किसी token से मेल खाते colors, qualify करते हैं; सबसे ज़्यादा इस्तेमाल वाले पहले आते हैं, 96 तक।
  3. लगभग-duplicates को मिलाना. Auto-named colors जो हर channel में 2/255 से ज़्यादा अलग नहीं हैं (#000000 और #010101), एक variable में मिला दिए जाते हैं, क्योंकि यह फ़र्क कोई देख नहीं सकता।
  4. पहले आपकी file में देखना. कुछ भी बनाने से पहले plugin file के local variables और styles खोजता है। 2/255 के अंदर वाला color variable दोबारा इस्तेमाल होता है, आपके अपने design system के variables समेत। Text style तब दोबारा इस्तेमाल होती है जब family, weight, size, line height, letter spacing, case और decoration सब मेल खाएँ। Shadow style तब, जब उसके effects बिल्कुल एक जैसे हों।
  5. जो नहीं है वह बनाना. नए variables Colors · <domain> में जाते हैं। हर एक को ऐसे scopes मिलते हैं जो site के इस्तेमाल से मेल खाते हैं (fill, text या stroke), ताकि variable picker उन्हें सही जगहों पर दिखाए।
  6. Bind. Layers variables और styles से जोड़ी जाती हैं, फिर बाकी build चलता है: Auto Layout, components, prototype links।

क्योंकि step 4 हमेशा चलता है, वही site दो बार import करने पर कुछ भी नया नहीं बनता: दूसरा import पहले वाले के हर variable और style को ढूँढकर उनसे link करता है। एक site के दस पेज आख़िर में एक ही collection साझा करते हैं।

Results screen एक line में सार देती है, जैसे "Linked to … color variables (… reused from this file), … text styles, … shadow styles"।

मान एक जैसा हो तो दोबारा इस्तेमाल, पास हो तो snap

यह अलग क्यों है

कई tools अब import हुए पेजों को design system से जोड़ते हैं। उनके रास्ते अलग हैं:

ToolPublic docs क्या बताते हैं (अक्टूबर 2026)
HTML to FramesSite की CSS custom properties के नाम वाले color variables, text styles, shadow styles; आपकी file के मिलते variables और styles पहले दोबारा इस्तेमाल होते हैं (Pro)
html.to.designपेज से color और text styles बनाता है, या आपकी file की local styles लगाता है (Free plan पर भी)
Figma का अपना Chrome extensionCapture हुई layers को आपकी file में पहले से मौजूद variables से bind करता है (paid Figma plans, beta)

व्यावहारिक फ़र्क है नामों का स्रोत। जिन public docs की हमने समीक्षा की (अक्टूबर 2026), उनमें हमें कोई दूसरा importer नहीं मिला जो variables के नाम site की CSS custom properties पर रखता हो। Design system team के लिए यह मायने रखता है: Figma में brand/primary और code में --brand-primary एक ही बातचीत है। Builder.io, Codia, Anima और html2design layers और layout पर ध्यान देते हैं; उनके जिन public पेजों की हमने समीक्षा की, उनमें CSS tokens से variables बनाने का वर्णन नहीं है।

html.to.design के साथ न्याय करते हुए: उसके Free plan में styles शामिल हैं, जबकि HTML to Frames में यह Pro feature है। Pro जो जोड़ता है वह है variables (सिर्फ़ styles नहीं), code से आए नाम, shadow styles, और ऐसा reuse जिससे बार-बार के imports साफ़ रहते हैं।

इसे कैसे इस्तेमाल करें

  1. Figma में HTML to Frames खोलें और Link tab में URL paste करें (या Multiple, Local file या Browser इस्तेमाल करें)।
  2. Options में पक्का करें कि Styles & variables चालू है। Pro और Team पर यह default से चालू है।
  3. चाहें तो अपने design system की सबसे नज़दीकी values दोबारा इस्तेमाल करने के लिए Snap to my file's styles चालू करें (नीचे related लेख देखें)।
  4. Import दबाएँ।
  5. Figma का Variables panel खोलें: Colors · <domain> collection वहाँ है, और text व shadow styles local styles list में हैं।
Styles & variables, Snap to my file's styles और Components & hover states वाली plugin options list
Styles & variables, Options list में सबसे ऊपर है

Free plan पर इस option पर PRO badge दिखता है। Launch पर Pro $7/माह है और Figma के अंदर ही ख़रीदा जाता है; Team में यह पाँच seats के लिए शामिल है।

यह सबसे ज़्यादा कब काम आता है

  • Design system audits. Production site import करें और देखें कि असल में कौन से colors और type sizes ship होते हैं — grouped और named।
  • Agency onboarding. नए client का brand palette उनके codebase जैसे नामों वाले variables बनकर आता है, redesign proposal के लिए तैयार।
  • Redesigns. brand/primary एक बार बदलें और हर import हुआ पेज साथ बदल जाता है।
  • Design और dev की बातचीत. जब designers और developers एक ही token नाम इस्तेमाल करते हैं, तो handoff के सवाल छोटे हो जाते हैं।
  • Multi-page imports. Multiple से दस पेज import करें, और वे palette की दस copies की बजाय एक ही collection साझा करते हैं।

जानने लायक बातें

  • हर import की limits: 96 color variables और 48 text styles। सिर्फ़ दोहराई गई shadows ही shadow styles बनती हैं।
  • Transparency paint पर opacity के रूप में रहती है, और gradient stops variables से bind नहीं होते।
  • Reuse file के local variables और styles देखता है, इसलिए उसी file में import करें जहाँ आपके tokens हैं।
  • अगर आपके Figma plan की variable limit पूरी हो जाए, तो plugin variables जोड़ना बंद कर देता है और बाकी colors सादी values रखते हैं।
  • बिना CSS custom properties वाली sites को भी variables मिलते हैं, बस blue/500 जैसे वर्णनात्मक नामों के साथ।
  • Styles & variables, Pro और Team feature है।

और देखें

Plugin लें और कोई ऐसी site import करें जिसे आप अच्छी तरह जानते हैं: Variables panel खोलेंगे तो नाम पहचाने हुए लगेंगे।

अक्सर पूछे जाने वाले सवाल

क्या मैं CSS variables को अपने-आप Figma variables में बदल सकता हूँ?
हाँ। Styles & variables चालू होने पर HTML to Frames पेज में declare हुई color custom properties पढ़ता है और उनके नाम पर Figma color variables बनाता है, यानी --brand-primary बनता है brand/primary। कम से कम दो बार इस्तेमाल हुए colors भी शामिल होते हैं, Colors · <domain> collection में 96 variables तक।
अगर मैं वही site दो बार import करूँ तो क्या होगा?
कुछ भी नया नहीं बनता। Variable या style बनाने से पहले plugin आपकी file में उसी value वाला एक ढूँढता है और उसे दोबारा इस्तेमाल करता है। दूसरा import पहले वाले के variables और styles से link करता है, इसलिए multi-page imports एक ही collection साझा करते हैं।
क्या यह मेरे मौजूदा design system variables इस्तेमाल करता है?
Value मेल खाए तो हाँ। हर channel में 2/255 के अंदर वाला local color variable दोबारा इस्तेमाल होता है, और text व shadow styles तब, जब उनकी settings बिल्कुल मेल खाएँ। करीब लेकिन बराबर न होने वाली values के लिए Snap to my file's styles चालू करें।
अगर site CSS custom properties इस्तेमाल नहीं करती तो?
आपको फिर भी variables मिलते हैं। कम से कम दो बार इस्तेमाल हुए colors, blue/500 या neutral/900 जैसे वर्णनात्मक नामों वाले variables बनते हैं। Text और shadow styles दोनों हालात में एक ही तरह बनती हैं।
Styles & variables किस plan में शामिल है?
Styles & variables, Pro और Team में शामिल है। Launch पर Pro $7 प्रति माह है और Figma के अंदर ही ख़रीदा जाता है। Free plan पर यह option PRO badge के साथ दिखता है।

Web pages को दोबारा हाथ से बनाना अब बंद।

Link paste कीजिए और कुछ ही सेकंड में असली, editable, responsive Figma layers पाइए। शुरुआत मुफ़्त है — हर महीने 10 imports।

Web pages को दोबारा हाथ से बनाना अब बंद।

Link paste कीजिए और कुछ ही सेकंड में असली, editable, responsive Figma layers पाइए। शुरुआत मुफ़्त है — हर महीने 10 imports।

Credit card की ज़रूरत नहीं। Pro सीधे Figma के अंदर ही ख़रीदा जाता है।

जल्द ही Figma Community पर