Naalya Handbook

Styling and theming

Tailwind v4 in CSS-first mode, the two-layer token rule, cn() and CVA, and why dark mode is off site-wide.

All styling config lives in one file, app/app.css, imported once at the top of app/root.tsx. There is no tailwind.config.js and no postcss.config; never add one.

Dark mode is off everywhere

app/routes/_layout.tsx resets the theme to light on every render, and every page with UI sits inside that layout. There is no theme toggle, so dark: classes and the .dark tokens never apply. Turning dark mode on means relaxing that effect first.

What lives where

NeedWhereExample
Engine and pluginsTop of app/app.css@import "tailwindcss", @plugin "@tailwindcss/typography"
Extra class sources@source in app/app.css@source "/node_modules/streamdown/dist/index.js"
Dark mode strategy@custom-variant in app/app.cssdark (&:is(.dark *)), class based
Colors (raw values):root and .dark in app/app.css--primary: oklch(...)
Colors, radii, animations as utilities@theme inline block--color-primary: var(--primary)
FontsPlain @theme block--font-sans, --font-poppins, --font-display
Class mergingcn() in app/lib/utils.tstwMerge(clsx(inputs))
Component variantscva() in app/components/ui/*buttonVariants
Theme stateZustand useTheme in app/components/providers/theme.provider.tsxpersisted as naalya-theme

Keep these two lines

The @source line keeps the classes used by the streamdown markdown renderer; without it the AI chat loses its styling. The biome-ignore-all comment on line 1 stops Biome flagging the v4 at-rules. components.json has "config": "" on purpose: it tells shadcn there is no JS config.

Adding a color token

A color needs both layers. Miss the raw value and the utility resolves to nothing; miss the mapping and the utility doesn't exist.

Add the raw value to both :root and .dark, in OKLCH.

app/app.css
:root { --brand: oklch(0.62 0.19 25); }
.dark { --brand: oklch(0.70 0.17 25); }

Map it in @theme inline so bg-brand, text-brand and the rest exist.

app/app.css
@theme inline { --color-brand: var(--brand); }

inline makes the utility read the live variable, so flipping .dark re-themes it without a rebuild. A color in the plain @theme block would never switch.

The same pattern gives radii (--radius-2xl makes rounded-2xl) and animations (--animate-foo makes animate-foo). An animation needs both the --animate-* token and its @keyframes: the blob-float-1/2/3 keyframes have no token, so animate-blob-1 does not exist.

The dark palette swaps roles rather than darkening: in .dark, --primary takes the light theme's secondary blue and --secondary becomes yellow.

Composing classes and variants

cn() from @/lib/utils merges classes with last-wins rules, so a caller's className overrides the default:

cn("rounded-md px-4", isActive && "bg-primary", "px-8")
// "rounded-md bg-primary px-8"

Eleven primitives in app/components/ui/ use CVA. To write a new one, copy the shape of button.tsx:

  1. const fooVariants = cva(base, { variants, defaultVariants }).
  2. Type props with VariantProps<typeof fooVariants>.
  3. Render className={cn(fooVariants({ variant, size, className }))} so the caller can override.
  4. Put data-slot="foo" on the root element.
  5. Export both the component and fooVariants.

Use asChild (Radix Slot) to render a primitive as another element, for example <Button asChild><Link to="/contact">Contact</Link></Button>, instead of copying button classes onto a link.

Theming

Custom useThemenext-themes
Import from@/components/providers/theme.providernext-themes
Used byThe whole app; toggles .light or .dark on <html>app/components/ui/sonner.tsx only
EffectDrives every dark: classNo provider is mounted, so it does nothing useful

Import the custom hook for anything theme related; importing the next-themes one silently does nothing.

To support both themes in a component, build from semantic tokens (bg-background, text-foreground, bg-card, border-border). They flip with .dark, usually with no dark: classes at all.

Fonts and prose

TokenFontLoaded by
font-poppinsPoppinsGoogle Fonts @import in app/app.css; applied to body, so it is what you see
font-sansInter<link> in app/root.tsx
font-displayInstrument Serif<link> in app/root.tsx

The prose class (typography plugin) styles long-form Sanity and markdown content on pages like blog-post.tsx and about.tsx. Use not-prose to escape it, and don't use it for app chrome.

On this page