# Styles

Design system globals and theme CSS for consumer apps.

## Installation

```bash
npx shadcn@latest add https://reactdocs.canceydejean.dev/r/styles.json
```

[Registry JSON](https://reactdocs.canceydejean.dev/r/styles.json)

## Source

### globals.css

```css
@import "tailwindcss";
@import "tw-animate-css";
@import "shadcn/tailwind.css";
/* Supports weights 100-900 */
@import "@fontsource-variable/inter/wght.css";
@plugin "@tailwindcss/typography";
@import "./theme.css";
@import "./theme-secondary.css";
@import "./theme-tertiary.css";

@custom-variant dark (&:is(.dark *));

@supports (interpolate-size: allow-keywords) {
  :root {
    interpolate-size: allow-keywords;
  }
}

@layer base {
  * {
    @apply border-border outline-ring;
  }

  html {
    @apply font-body;
  }

  body {
    @apply bg-background text-foreground overflow-x-hidden antialiased selection:bg-red-500/20 selection:text-red-200;
  }

  a {
    @apply inline-block hover:underline;
  }

  button {
    @apply cursor-pointer;
  }
}

@utility transition-smooth {
  @apply transition duration-300 ease-in-out;
}

/* Hide default arrows from number inputs. */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

/* Hide the default clear button (X) from search inputs. */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
```


### theme.css

```css
@theme inline {
  --radius: 0.625rem;
  --font-body: "Inter Variable", sans-serif;

  /* Font sizes */
  --text-10: 10px;
  --text-12: 12px;
  --text-14: 14px;
  --text-16: 16px;
  --text-18: 18px;
  --text-20: 20px;
  --text-24: 24px;
  --text-30: 30px;
  --text-36: 36px;
  --text-48: 48px;
  --text-60: 60px;
  --text-72: 72px;
  --text-96: 96px;
  --text-120: 120px;

  --color-sidebar-ring: var(--sidebar-ring);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar: var(--sidebar);
  --color-chart-5: var(--chart-5);
  --color-chart-4: var(--chart-4);
  --color-chart-3: var(--chart-3);
  --color-chart-2: var(--chart-2);
  --color-chart-1: var(--chart-1);
  --color-ring: var(--ring);
  --color-input: var(--input);
  --color-border: var(--border);
  --color-destructive: var(--destructive);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent: var(--accent);
  --color-muted-foreground: var(--muted-foreground);
  --color-muted: var(--muted);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-secondary: var(--secondary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary: var(--primary);
  --color-popover-foreground: var(--popover-foreground);
  --color-popover: var(--popover);
  --color-card-foreground: var(--card-foreground);
  --color-card: var(--card);
  --color-foreground: var(--foreground);
  --color-background: var(--background);

  /* Radius */
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
}

:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.556 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  --chart-1: oklch(0.646 0.222 41.116);
  --chart-2: oklch(0.6 0.118 184.704);
  --chart-3: oklch(0.398 0.07 227.392);
  --chart-4: oklch(0.828 0.189 84.429);
  --chart-5: oklch(0.769 0.188 70.08);
  --sidebar: oklch(0.985 0 0);
  --sidebar-foreground: oklch(0.145 0 0);
  --sidebar-primary: oklch(0.205 0 0);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.97 0 0);
  --sidebar-accent-foreground: oklch(0.205 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-ring: oklch(0.708 0 0);
  --selection: oklch(0.145 0 0);
  --selection-foreground: oklch(1 0 0);
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --card-foreground: oklch(0.985 0 0);
  --popover: oklch(0.205 0 0);
  --popover-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0);
  --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0);
  --muted-foreground: oklch(0.708 0 0);
  --accent: oklch(0.269 0 0);
  --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --ring: oklch(0.556 0 0);
  --chart-1: oklch(0.488 0.243 264.376);
  --chart-2: oklch(0.696 0.17 162.48);
  --chart-3: oklch(0.769 0.188 70.08);
  --chart-4: oklch(0.627 0.265 303.9);
  --chart-5: oklch(0.645 0.246 16.439);
  --sidebar: oklch(0.205 0 0);
  --sidebar-foreground: oklch(0.985 0 0);
  --sidebar-primary: oklch(0.488 0.243 264.376);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-accent: oklch(0.269 0 0);
  --sidebar-accent-foreground: oklch(0.985 0 0);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.556 0 0);
}
```


### theme-secondary.css

```css
[data-theme="theme-secondary"] {
  --primary: oklch(0.72 0.19 50);
  --primary-foreground: oklch(0.145 0 0);
  --ring: oklch(0.72 0.19 50);
  --sidebar-primary: oklch(0.72 0.19 50);
  --sidebar-primary-foreground: oklch(0.145 0 0);
  --sidebar-ring: oklch(0.72 0.19 50);
  --selection: oklch(0.72 0.19 50);
  --selection-foreground: oklch(0.145 0 0);
  --chart-1: oklch(0.72 0.19 50);
  --chart-2: oklch(0.65 0.24 25);
  --chart-3: oklch(0.8 0.17 85);
  --chart-4: oklch(0.6 0.2 15);
  --chart-5: oklch(0.75 0.12 60);
}

.dark[data-theme="theme-secondary"] {
  --primary: oklch(0.78 0.18 55);
  --primary-foreground: oklch(0.145 0 0);
  --ring: oklch(0.78 0.18 55);
  --sidebar-primary: oklch(0.78 0.18 55);
  --sidebar-primary-foreground: oklch(0.145 0 0);
  --sidebar-ring: oklch(0.78 0.18 55);
  --selection: oklch(0.78 0.18 55);
  --selection-foreground: oklch(0.145 0 0);
  --chart-1: oklch(0.78 0.18 55);
  --chart-2: oklch(0.7 0.22 30);
  --chart-3: oklch(0.85 0.16 88);
  --chart-4: oklch(0.65 0.2 18);
  --chart-5: oklch(0.8 0.11 62);
}
```


### theme-tertiary.css

```css
[data-theme="theme-tertiary"] {
  --primary: oklch(0.55 0.24 295);
  --primary-foreground: oklch(0.985 0 0);
  --ring: oklch(0.55 0.24 295);
  --sidebar-primary: oklch(0.55 0.24 295);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-ring: oklch(0.55 0.24 295);
  --selection: oklch(0.55 0.24 295);
  --selection-foreground: oklch(0.985 0 0);
  --chart-1: oklch(0.55 0.24 295);
  --chart-2: oklch(0.6 0.2 250);
  --chart-3: oklch(0.65 0.18 200);
  --chart-4: oklch(0.5 0.26 320);
  --chart-5: oklch(0.7 0.14 260);
}

.dark[data-theme="theme-tertiary"] {
  --primary: oklch(0.68 0.22 293);
  --primary-foreground: oklch(0.985 0 0);
  --ring: oklch(0.68 0.22 293);
  --sidebar-primary: oklch(0.68 0.22 293);
  --sidebar-primary-foreground: oklch(0.985 0 0);
  --sidebar-ring: oklch(0.68 0.22 293);
  --selection: oklch(0.68 0.22 293);
  --selection-foreground: oklch(0.985 0 0);
  --chart-1: oklch(0.68 0.22 293);
  --chart-2: oklch(0.72 0.18 248);
  --chart-3: oklch(0.75 0.16 198);
  --chart-4: oklch(0.62 0.24 318);
  --chart-5: oklch(0.8 0.12 258);
}
```



## Usage

Install the design system CSS foundation, then import `globals.css` in your app entry stylesheet or root layout.

```sh
npx shadcn@latest add @design-system-ui/styles
```

```tsx
import "@/styles/globals.css";
```

This writes:

- `src/styles/globals.css`
- `src/styles/theme.css`
- `src/styles/theme-secondary.css`
- `src/styles/theme-tertiary.css`

If those paths already exist, the shadcn CLI may prompt before overwriting.

Set `data-theme="theme-secondary"` or `data-theme="theme-tertiary"` on `<html>` to switch accents, or add your own palette file. See [Theming](/docs/theming).

