Theming

Apply a tweakcn theme from the CLI, or customize the CSS variables yourself.

Every ShellUI component is styled with CSS variables (--background, --primary, --radius, …) through Tailwind CSS 4.3.2. Change the variables and every component follows, including charts.

Apply a theme from tweakcn

The 0.3 CLI fetches a public tweakcn theme by URL or theme ID and writes its variables into your project.

1. Pick a theme

Design or choose a theme on tweakcn.com and copy its URL.

2. Apply it

bash
shellui theme apply <url-or-id>

This writes the variables to wwwroot/input.css. To keep them in a separate file instead, pass --emit-override wwwroot/theme.css and link that file after the ShellUI stylesheet.

3. Keep it in sync

bash
shellui theme update

Re-fetches the theme recorded in shellui.theme.lock. Run it from the project root.

Starting a new project? shellui theme init <url-or-id> runs shellui init and applies the theme in one step. It accepts the same options as init, such as --tailwind standalone|npm and --yes.

Customize the variables

You can also edit the variables directly in wwwroot/input.css:

css
@import "tailwindcss";

:root {
  --background: oklch(0.99 0 0);
  --foreground: oklch(0 0 0);
  --primary: oklch(0 0 0);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.94 0 0);
  --secondary-foreground: oklch(0 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.44 0 0);
  --accent: oklch(0.94 0 0);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.63 0.19 23.03);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.92 0 0);
  --input: oklch(0.94 0 0);
  --ring: oklch(0 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0 0 0);
  --radius: 0.5rem;
  color-scheme: light;
}

With the NuGet package, put your overrides in a stylesheet linked after _content/ShellUI.Components/shellui-theme.css so they win.

Dark mode

Dark mode is class-based: the dark class on <html> switches to the .dark variables. shellui init adds a script to App.razor that applies the saved theme before Blazor starts, so the page doesn't flash.

css
.dark {
  --background: oklch(0 0 0);
  --foreground: oklch(1 0 0);
  --primary: oklch(1 0 0);
  --primary-foreground: oklch(0 0 0);
  --card: oklch(0.14 0 0);
  --card-foreground: oklch(1 0 0);
  --border: oklch(0.26 0 0);
  color-scheme: dark;
  /* …the rest of the variables */
}

color-scheme tells the browser to draw its own controls (the date picker calendar, number spinners, scrollbars, autofill, <select> lists) in the matching theme. The theme shellui init and shellui theme apply write includes it from 0.3.4; in an older input.css, add the two lines yourself.

Let users switch with ThemeToggle:

Charts

Chart containers use --radius, --shadow, --border, --card and --card-foreground, so they match your theme. The series colors come from the ChartTheme enum: Default, Colorful or Monochrome. See Charts.

Fonts

ShellUI reads --font-sans and --font-mono. Load a font, then point the variables at it:

html
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
css
:root {
  --font-sans: 'Inter', sans-serif;
}

Per-component changes

Every component accepts Class, which is merged with its default classes. From 0.3.5, your classes win: when one of yours sets the same CSS property as a default class under the same variants, the default is dropped, like tailwind-merge. <Card Class="max-w-lg"> replaces the card's max-w-md, and p-4 replaces px-2. Classes that don't conflict (a text colour and a text size, say) are both kept, and classes ShellUI doesn't recognise pass through. You no longer need Tailwind's ! modifier to beat a default. In a CLI project, shellui update shell brings in the new merge.

razor
<Card Class="max-w-lg p-8">...</Card>
<Button Class="bg-emerald-600 hover:bg-emerald-700">Save</Button>

When you install with the CLI, you own the component source in Components/UI/ and can change anything.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.