Home / Function/ buildGlobalsCss() — ui Function Reference

buildGlobalsCss() — ui Function Reference

Architecture documentation for the buildGlobalsCss() function in route.ts from the ui codebase.

Entity Profile

Dependency Diagram

graph TD
  837d12e4_48d5_fc67_ec0c_328d5f0e4eb9["buildGlobalsCss()"]
  2306a3f2_6413_2045_0888_633ffb84f9ee["route.ts"]
  837d12e4_48d5_fc67_ec0c_328d5f0e4eb9 -->|defined in| 2306a3f2_6413_2045_0888_633ffb84f9ee
  99866bc1_a32a_eb11_ee85_68ceecc601f6["buildV0Payload()"]
  99866bc1_a32a_eb11_ee85_68ceecc601f6 -->|calls| 837d12e4_48d5_fc67_ec0c_328d5f0e4eb9
  style 837d12e4_48d5_fc67_ec0c_328d5f0e4eb9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

apps/v4/app/(create)/create/v0/route.ts lines 82–165

function buildGlobalsCss(registryBase: RegistryItem) {
  const lightVars = Object.entries(registryBase.cssVars?.light ?? {})
    .map(([key, value]) => `  --${key}: ${value};`)
    .join("\n")

  const darkVars = Object.entries(registryBase.cssVars?.dark ?? {})
    .map(([key, value]) => `  --${key}: ${value};`)
    .join("\n")

  const content = dedent`@import "tailwindcss";
@import "tw-animate-css";
/* @import "shadcn/tailwind.css"; */

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

@theme inline {
  --font-sans: var(--font-sans);
  --font-mono: var(--font-mono);
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-foreground: var(--muted-foreground);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-border: var(--border);
  --color-input: var(--input);
  --color-ring: var(--ring);
  --color-chart-1: var(--chart-1);
  --color-chart-2: var(--chart-2);
  --color-chart-3: var(--chart-3);
  --color-chart-4: var(--chart-4);
  --color-chart-5: var(--chart-5);
  --color-sidebar: var(--sidebar);
  --color-sidebar-foreground: var(--sidebar-foreground);
  --color-sidebar-primary: var(--sidebar-primary);
  --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
  --color-sidebar-accent: var(--sidebar-accent);
  --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
  --color-sidebar-border: var(--sidebar-border);
  --color-sidebar-ring: var(--sidebar-ring);
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);
  --radius-4xl: calc(var(--radius) + 16px);
}

:root {
  ${lightVars}
}

.dark {
  ${darkVars}
}

@layer base {
  * {
    @apply border-border outline-ring/50;
  }
  body {
    @apply bg-background text-foreground;
  }
}
  `

  return registryItemFileSchema.parse({
    path: "app/globals.css",
    type: "registry:file",
    target: "app/globals.css",

Domain

Subdomains

Called By

Frequently Asked Questions

What does buildGlobalsCss() do?
buildGlobalsCss() is a function in the ui codebase, defined in apps/v4/app/(create)/create/v0/route.ts.
Where is buildGlobalsCss() defined?
buildGlobalsCss() is defined in apps/v4/app/(create)/create/v0/route.ts at line 82.
What calls buildGlobalsCss()?
buildGlobalsCss() is called by 1 function(s): buildV0Payload.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free