我们精心设计了 Flux,使其开箱即用就具有出色的外观;不过,每个项目都有自己的风格定位。你可以从我们精选的配色方案中进行选择,或通过自定义 CSS 变量来构建你自己的主题。
/* resources/css/app.css *//* Re-assign Flux's gray of choice... */@theme { --color-zinc-50: var(--color-slate-50); --color-zinc-100: var(--color-slate-100); --color-zinc-200: var(--color-slate-200); --color-zinc-300: var(--color-slate-300); --color-zinc-400: var(--color-slate-400); --color-zinc-500: var(--color-slate-500); --color-zinc-600: var(--color-slate-600); --color-zinc-700: var(--color-slate-700); --color-zinc-800: var(--color-slate-800); --color-zinc-900: var(--color-slate-900); --color-zinc-950: var(--color-slate-950);}
<flux:text class="text-slate-800 dark:text-white">...</flux:text>
/* resources/css/app.css */@theme { --color-accent: var(--color-red-500); --color-accent-content: var(--color-red-600); --color-accent-foreground: var(--color-white);}@layer theme { .dark { --color-accent: var(--color-red-500); --color-accent-content: var(--color-red-400); --color-accent-foreground: var(--color-white); }}
|
变量
|
说明
|
|---|---|
| --color-accent | 主要的强调色,用作主按钮的背景色。 |
| --color-accent-content | 通常更深的色相,用于文本内容以提升可读性。 |
| --color-accent-foreground | 在强调色背景之上的文本内容颜色(通常为文字颜色)。 |
<button class="bg-[var(--color-accent)] text-[var(--color-accent-foreground)]">
<button class="bg-accent text-accent-foreground">
<!-- Link --><flux:link :accent="false">Profile</flux:tab><!-- Tabs --><flux:tabs> <flux:tab :accent="false">Profile</flux:tab> <flux:tab :accent="false">Account</flux:tab> <flux:tab :accent="false">Billing</flux:tab></flux:tabs><!-- Navbar --><flux:navbar> <flux:navbar.item :accent="false">Profile</flux:navbar.item> <flux:navbar.item :accent="false">Account</flux:navbar.item> <flux:navbar.item :accent="false">Billing</flux:navbar.item></flux:navbar><!-- Navlist --><flux:navlist> <flux:navlist.item :accent="false">Profile</flux:navlist.item> <flux:navlist.item :accent="false">Account</flux:navlist.item> <flux:navlist.item :accent="false">Billing</flux:navlist.item></flux:navlist>