Tokens
@flow-industries/ui द्वारा expose किए जाने वाले सभी CSS custom properties।
Flow UI एक छोटा, stable CSS custom properties का set expose करता है। बाकी सब कुछ — component colors, backgrounds, border widths, animations — इन्हीं से derive होता है। किसी भी एक को :root पर (या .dark के अंदर) override करके पूरे system को retheme करें।
Source: @flow-industries/ui/styles/tokens.css।
Colors
सभी रंग perceptual uniformity के लिए OKLch में define किए गए हैं। Light-mode values :root में हैं; dark-mode overrides .dark में हैं।
Surface
| Token | उद्देश्य |
|---|---|
--background | Page background |
--foreground | Default text |
--muted | सूक्ष्म surfaces (inputs, sidebars) |
--muted-foreground | कम जोर वाला text |
--overlay | Dialogs और drawers के लिए semi-transparent scrim |
Intent
| Token | उद्देश्य |
|---|---|
--primary / --primary-foreground | Primary buttons और emphasis |
--secondary / --secondary-foreground | कम जोर वाले buttons और tags |
--destructive | Destructive actions |
--success / --success-background / --success-foreground | Success — solid fill, हल्का tinted surface, और उस surface पर दिखने वाला हरा text |
--brand / --brand-foreground / --brand-text | Flow pink brand surface, उस पर foreground, और AA-contrast brand text |
--focus | Focus border color |
--input / --input-focus | Input background, और focus पर उसका tint |
Raw palette
अगर आपको semantic tokens से आगे जाना हो तो यह भी expose हैं:
--color-pink, --color-green, --color-blue, --color-purple, --color-red, --color-orange, --color-yellow।
हर रंग एक हल्का और एक गहरा शेड भी देता है — उन्हीं सात नामों पर --color-light-* और --color-dark-* (जैसे --color-light-pink, --color-dark-green)। Semantic tokens जहाँ ठीक बैठे वहाँ इन्हीं पर बनते हैं: --brand और --focus दोनों --color-pink हैं। --success एक fixed हरा (#09b270) है, और --success-background व --input-focus color-mix() tints हैं — success background पर, focus input पर। --success-foreground उस text का हरा रंग है — light mode में एक गहरा हरा (#067447) ताकि tinted surface पर contrast पढ़ने योग्य रहे, और dark mode में --success ही।
Typography
Families
| Token | Font |
|---|---|
--font-sans | Geist Sans |
--font-mono | Geist Mono |
Size scale
--text-xs से --text-9xl तक। हर size Tailwind default से ~10% ऊपर है ताकि अधिक खुला एहसास हो। पूरी scale:
xs, sm, base, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl, 7xl, 8xl, 9xl।
Line heights
--leading-none, --leading-tight, --leading-snug, --leading-normal, --leading-relaxed, --leading-loose।
Letter spacing
--tracking-tighter, --tracking-tight, --tracking-normal, --tracking-wide, --tracking-wider, --tracking-widest। Defaults Apple-style tight-by-default aesthetic की ओर झुकते हैं।
Spacing और sizing
Borders:
| Token | Default |
|---|---|
--border-width | 2px |
--border-width-focus | 2px |
Flow UI कभी focus rings use नहीं करता। Inputs border color swap करके focus दिखाते हैं (border-focus), जिससे overall layout stable रहता है।
सभी Radii --radius से calc() के ज़रिए derive होते हैं, इसलिए --radius को override करने से हर step फिर से reshape हो जाता है:
| Token | अभिव्यक्ति |
|---|---|
--radius | 0.75rem (base) |
--radius-sm | calc(var(--radius) - 4px) |
--radius-md | calc(var(--radius) - 2px) |
--radius-lg | var(--radius) |
--radius-xl | calc(var(--radius) + 4px) |
--radius-2xl | calc(var(--radius) + 8px) |
--radius-3xl | calc(var(--radius) + 12px) |
--radius-4xl | calc(var(--radius) + 16px) |
--radius-squircle | var(--squircle-radius, 35%) |
--radius-squircle, वर्गाकार media (avatars, thumbnails) द्वारा उपयोग की जाने वाली rounded-squircle utility को support करता है: डिफ़ॉल्ट रूप से 35%, जो उन्हें वृत्त के बजाय गोल कोनों वाला वर्ग बनाए रखता है।
जो ब्राउज़र corner-shape: superellipse(1.6) को support करते हैं, उनमें --radius बढ़ाकर 20px कर दिया जाता है — बड़े radii पर superellipse कोने बेहतर दिखते हैं — और --squircle-radius 50% तक पहुँच जाता है, जिसे superellipse एक वास्तविक squircle में बदल देता है।
Animation
| Token | Curve |
|---|---|
--ease-out | cubic-bezier(0.33, 1, 0.68, 1) |
--ease-out-expo | cubic-bezier(0.22, 1, 0.36, 1) |
--ease-spring | cubic-bezier(0.175, 0.885, 0.32, 1.275) |
Tailwind utilities में ease-(--ease-spring) के रूप में reference होते हैं।
Overriding
Globally retheme करने के लिए किसी भी token को :root पर set करें:
:root {
--brand: oklch(0.7 0.2 20); /* an orange brand */
--radius: 0.25rem; /* sharper corners everywhere */
}सिर्फ dark mode को प्रभावित करने के लिए .dark के अंदर override करें:
.dark {
--background: oklch(0.15 0 0);
--foreground: oklch(0.95 0 0);
}पूरा multi-palette setup देखने के लिए Theming पढ़ें।