Styles

Install the design system CSS foundation with the shadcn-svelte CLI.

Before components look correct, add the design system style files. This installs globals.css plus the default, secondary, and tertiary theme presets into styles/ at the project root.

Prerequisites

Your project should already be set up with shadcn-svelte and Tailwind CSS. See Installation for the full setup flow.

Install

What gets installed

FileDestination
globals.cssstyles/globals.css
theme.cssstyles/theme.css
theme-secondary.cssstyles/theme-secondary.css
theme-tertiary.cssstyles/theme-tertiary.css

The CLI also installs the packages the stylesheet depends on (tailwindcss, tw-animate-css, and @fontsource-variable/inter).

If those files already exist, the CLI may ask before overwriting them.

Import in your app

Import the globals entry once from your root layout (src/routes/+layout.svelte) or app entry:

1<script>
2  import "../../styles/globals.css";
3</script>

globals.css already imports ./theme.css, ./theme-secondary.css, and ./theme-tertiary.css, so you do not need a second import for the theme tokens.

Theme presets

The published styles are a CSS-first token set for Tailwind v4: a base theme (theme.css) plus two alternate presets. Swap the active preset per-page or per-user by setting data-theme="theme-secondary" (or theme-tertiary) on <html>; omit the attribute for the default palette.

1document.documentElement.dataset.theme = "theme-secondary"; // or "theme-tertiary"

Each preset only overrides --primary, --ring, --sidebar-primary, --selection, and the --chart-* scale — everything else (background, foreground, card, border, radius) is shared, so switching presets only changes the accent, not the whole surface.

Type scale

theme.css defines the font-size scale inside @theme inline. Tailwind turns each --text-* token into a utility of the same name, so --text-60 is the class text-60.

UtilitySize
text-1010px
text-1212px
text-1414px
text-1616px
text-1818px
text-2020px
text-2424px
text-3030px
text-3636px
text-4848px
text-6060px
text-7272px
text-9696px
text-120120px

Heading uses the upper end of that scale and steps up at the sm breakpoint (640px):

SizeBasesm
xstext-20text-20
smtext-20text-24
mdtext-24text-30
lgtext-30text-36
xltext-36text-48
2xltext-48text-60
3xltext-60text-72

Text uses the smaller end (text-12 through text-20) and steps up at the same breakpoint.

Keeping sizes when classes merge

cn and tailwind-variants know Tailwind’s built-in sizes (text-sm, text-xl). Every other text-* class is classified as a text color. A recipe that sets both text-60 and text-foreground loses text-60 in the merge, and the element keeps the inherited font size. sm:text-72 lives in its own group, so the larger breakpoint can still apply and the missing size shows up only below sm.

This repo registers the scale as font sizes in registry/items/lib/utils.ts (themeTextSizes and cnConfig). $lib/utils re-exports that cn and cnConfig. Pass the same config to every tv() recipe that mixes a scale size with a color:

1import { tv } from "tailwind-variants";
2import { cnConfig } from "$lib/utils.js";
3
4export const headingVariants = tv(
5  {
6    variants: {
7      size: { md: "text-24 sm:text-30" },
8      tone: { default: "text-foreground" },
9    },
10  },
11  { twMergeConfig: cnConfig },
12);

Add a new size in both places: a --text-* custom property in theme.css, and the same name in themeTextSizes.

Next steps

Browse the components catalog and follow the install command on each item page. The styles item page has the same usage notes as this guide.