FLOWDocs

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उद्देश्य
--backgroundPage background
--foregroundDefault text
--mutedसूक्ष्म surfaces (inputs, sidebars)
--muted-foregroundकम जोर वाला text
--overlayDialogs और drawers के लिए semi-transparent scrim

Intent

Tokenउद्देश्य
--primary / --primary-foregroundPrimary buttons और emphasis
--secondary / --secondary-foregroundकम जोर वाले buttons और tags
--destructiveDestructive actions
--success / --success-background / --success-foregroundSuccess — solid fill, हल्का tinted surface, और उस surface पर दिखने वाला हरा text
--brand / --brand-foreground / --brand-textFlow pink brand surface, उस पर foreground, और AA-contrast brand text
--focusFocus border color
--input / --input-focusInput 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

TokenFont
--font-sansGeist Sans
--font-monoGeist 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:

TokenDefault
--border-width2px
--border-width-focus2px

Flow UI कभी focus rings use नहीं करता। Inputs border color swap करके focus दिखाते हैं (border-focus), जिससे overall layout stable रहता है।

सभी Radii --radius से calc() के ज़रिए derive होते हैं, इसलिए --radius को override करने से हर step फिर से reshape हो जाता है:

Tokenअभिव्यक्ति
--radius0.75rem (base)
--radius-smcalc(var(--radius) - 4px)
--radius-mdcalc(var(--radius) - 2px)
--radius-lgvar(--radius)
--radius-xlcalc(var(--radius) + 4px)
--radius-2xlcalc(var(--radius) + 8px)
--radius-3xlcalc(var(--radius) + 12px)
--radius-4xlcalc(var(--radius) + 16px)
--radius-squirclevar(--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

TokenCurve
--ease-outcubic-bezier(0.33, 1, 0.68, 1)
--ease-out-expocubic-bezier(0.22, 1, 0.36, 1)
--ease-springcubic-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 पढ़ें।

On this page