Colors
Components use colors by name (bg-surface, text-muted, bg-primary); the current color theme gives their values, so no dark: classes are needed.
css/themes.css zubazar/ui · free (MIT)
Palette
The values of the color names in the built-in light and dark themes.
| Color | Name | Light | Dark | Usage |
|---|---|---|---|---|
| Primary | primary |
#794dff |
#794dff |
Buttons, links, selected states, the focus ring |
| Secondary | secondary |
#6b7280 |
#6b7280 |
Grey buttons and badges |
| Success | success |
#008933 |
#008933 |
Confirmed, completed, active |
| Info | info |
#038197 |
#038197 |
Information |
| Warning | warning |
#9f6b13 |
#9f6b13 |
Needs attention |
| Danger | danger |
#d83838 |
#d83838 |
Deleting, errors |
| Dark | dark |
#3f404d |
#2e2e2e |
The dark button |
| Accent | accent |
#3472d8 |
#3472d8 |
The logo mark, menu counters |
| Page | page |
#fafafa |
#0a0a0a |
The page background |
| Surface | surface |
#ffffff |
#141414 |
Cards, menus, the top bar, dialogs, drawers |
| Field | field |
#ffffff |
#1f1f1f |
Form fields, the white button |
| Sunken | sunken |
#f4f4f5 |
#1f1f1f |
Table heads, tab bars, kbd |
| Hover | hover |
#f4f4f5 |
#1f1f1f |
Rows and menu items |
| Track | track |
#e4e4e7 |
#2e2e2e |
Progress bars, skeletons |
| Inverse | inverse |
#18181b |
#2e2e2e |
Tooltips, toasts (text: on-inverse) |
| Line | line |
#e4e4e7 |
#2e2e2e |
Borders, dividers |
| Strong line | line-strong |
#d4d4d8 |
#474747 |
The frame of a form field |
| Control edge | control |
#8d8d95 |
#787878 |
Checkboxes and radio buttons |
| Heading | ink |
#18181b |
#f5f5f5 |
Heading text |
| Body | body |
#3f3f46 |
#d4d4d4 |
Body text |
| Secondary text | dim |
#52525c |
#a3a3a3 |
Secondary text |
| Muted text | muted |
#6f6f79 |
#a3a3a3 |
Hints, labels, placeholders |
| Faint | faint |
#9f9fa9 |
#787878 |
Decorative icons only, never text |
Backgrounds and text
The page uses bg-page, cards bg-surface and recessed areas bg-sunken; for text, headings use text-ink, body text text-body, secondary text text-dim and hints text-muted.
@foreach (['light' => 'Light mode', 'dark' => 'Dark mode'] as $theme => $name)
<div data-theme="{{ $theme }}" class="rounded-sm bg-page p-4 ring-1 ring-line">
<div class="space-y-1 rounded-sm bg-surface p-3 shadow-sm">
<p class="text-sm font-semibold text-ink">{{ $name }} · text-ink</p>
<p class="text-sm text-body">Body text · text-body</p>
<p class="text-sm text-muted">Hint · text-muted</p>
<p class="rounded-sm bg-sunken px-2 py-1 text-sm text-dim">Sunken area · bg-sunken</p>
</div>
</div>
@endforeach
| Prop | Values |
|---|---|
Background | bg-page · bg-surface · bg-field · bg-sunken · hover:bg-hover |
Text | text-ink · text-body · text-dim · text-muted |
Line | border-line · divide-line · ring-line-strong |
Meaning colors
Each color has a fill bg-{color} with its text text-on-{color}, a light background bg-{color}-tint with its text text-{color}-tint-ink, and text-{color}-ink for colored text.
<div class="space-y-2">
@foreach (['primary' => 'Primary', 'secondary' => 'Secondary', 'success' => 'Success', 'info' => 'Info', 'warning' => 'Warning', 'danger' => 'Danger', 'dark' => 'Dark', 'accent' => 'Accent'] as $color => $name)
<div class="flex flex-wrap items-center gap-2 text-sm">
<span class="w-20 text-muted">{{ $name }}</span>
<span class="rounded-sm bg-{{ $color }} px-3 py-1 text-on-{{ $color }}">Fill</span>
<span class="rounded-sm bg-{{ $color }}-tint px-3 py-1 text-{{ $color }}-tint-ink">Light background</span>
<span class="font-medium text-{{ $color }}-ink">Colored text</span>
</div>
@endforeach
</div>
| Prop | Values |
|---|---|
Colors | primary · secondary · success · info · warning · danger · dark · accent |
Names | {color} · {color}-hover · on-{color} · {color}-ink · {color}-line · {color}-tint · {color}-soft · {color}-tint-ink |
Status badges
Show statuses with a light background and a dark text of the same color; for highlights that report no status (e.g. "New record"), use primary.
<div class="flex flex-wrap gap-2 text-sm">
<span class="rounded-sm bg-success-tint px-3 py-2 text-success-tint-ink">Delivered</span>
<span class="rounded-sm bg-warning-tint px-3 py-2 text-warning-tint-ink">Pending</span>
<span class="rounded-sm bg-danger-tint px-3 py-2 text-danger-tint-ink">Cancelled</span>
<span class="rounded-sm bg-info-tint px-3 py-2 text-info-tint-ink">Notified</span>
<span class="rounded-sm bg-primary-tint px-3 py-2 text-primary-tint-ink">New record</span>
</div>
| Prop | Values |
|---|---|
Background and text | bg-{color}-tint text-{color}-tint-ink |
A slightly stronger background | bg-{color}-soft |
A dark or light part
Components inside an element with data-theme take that theme's colors.
<div data-theme="dark" class="space-y-3 rounded-sm bg-surface p-4">
<p class="text-sm text-body">A dark part: <span class="text-muted">data-theme="dark"</span></p>
<zb:button size="sm">New order</zb:button>
<div data-theme="light" class="rounded-sm bg-surface p-3 text-sm text-body">
A light island inside: <span class="text-muted">data-theme="light"</span>
</div>
</div>
| Prop | Values |
|---|---|
data-theme | light · dark (nova, nova-dark… in Zubazar UI Pro's themes) |
Changing the primary color
To change the primary color, set --zb-tone-primary in your CSS file; every primary name, the links and the focus ring derive from it.
/* resources/css/app.css, after the @import lines */
@layer base {
:root, [data-theme] {
--zb-tone-primary: #0f766e;
}
}
| Prop | Values |
|---|---|
--zb-tone-primary | The base value of the primary color |
brand-color | default · green · red · yellow · blue · gray · dark · #rrggbb (layout prop) |
Props
The values the component takes. What are props and slots?
| Prop | Type | Default | Description |
|---|---|---|---|
--zb-tone-primary | — | #794dff | The primary color; every primary name derives from it |
--zb-tone-secondary | — | #6b7280 | The secondary (grey) color |
--zb-tone-success | — | #00ca4b | Success; its fill is the dark shade white text reads on (#008933) |
--zb-tone-info | — | #04b6d4 | Info; its fill is #038197 |
--zb-tone-warning | — | #fcaa1e | Warning; its fill is #9f6b13 |
--zb-tone-danger | — | #fb4141 | Danger; its fill is #d83838 |
--zb-tone-dark | — | #3f404d | The dark button; #2e2e2e in dark mode |
--zb-tone-accent | — | #3b82f6 | Accent (blue) |
--zb-page · --zb-surface · --zb-line · --zb-ink … | — | themes.css | The neutral names; a theme sets only those that differ |
--zb-focus | — | the primary tone | The keyboard focus ring (outline-focus, ring-focus) |
--zb-user-* | — | — | The user's measured color; written on <html> at runtime, don't set it yourself |
data-theme | — | light | <html> or any element: light · dark · nova · nova-dark… |
Advanced
The user's color
The theme switcher's color section shows seven presets and a free color picker; the choice applies to the whole interface at once and is kept in the browser. "Default" is the theme's own color.
<div class="space-y-4">
<zb:theme-switcher as="inline" :sections="['color']" :reset="false" />
<div class="flex flex-wrap items-center gap-3">
<zb:button>Save</zb:button>
<zb:button variant="soft">Draft</zb:button>
<a href="#" class="text-sm font-medium text-primary-ink hover:underline">Link</a>
</div>
</div>
| Prop | Values |
|---|---|
colors | true · false · key => [#rrggbb, name] |
custom | true · false (free color picker) |
Developer notes
- The same markup looks right in light and dark mode, in a dark part of the page and in the color the user picked; the current
data-themegives the values. - Text on a fill reads at least 4.5:1 in every color.
- The example joins the color names in a loop to stay short; write the full name in your own code (
bg-success), because Tailwind only finds full names. - In dark mode, a status badge's background turns translucent and its text lighter.
data-themechanges only the colors; give the part its background yourself (bg-surface). When nested, the nearestdata-themewins.- The user's color is measured before use: button text darkens where it wouldn't read 4.5:1; links and the focus ring read 4.5:1 on light backgrounds and show at least 3:1 on dark surfaces in dark mode.
- The other colors change with
--zb-tone-success,--zb-tone-danger…; the color the user picks takes precedence over these values. Pass a saved color to the layout with thebrand-colorprop.