Home / Function/ loadStylesheet() — tailwindcss Function Reference

loadStylesheet() — tailwindcss Function Reference

Architecture documentation for the loadStylesheet() function in compile.ts from the tailwindcss codebase.

Function typescript NodeServer Compiler calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  119395eb_05ee_4deb_739d_387fb03df2bf["loadStylesheet()"]
  86cbca6b_bfa0_804c_ee2e_2cc7a7aef7fe["compile.ts"]
  119395eb_05ee_4deb_739d_387fb03df2bf -->|defined in| 86cbca6b_bfa0_804c_ee2e_2cc7a7aef7fe
  4ceb6126_e004_1a29_2b41_a2a30ed1e0a3["createCompileOptions()"]
  4ceb6126_e004_1a29_2b41_a2a30ed1e0a3 -->|calls| 119395eb_05ee_4deb_739d_387fb03df2bf
  10dd1778_d5d6_7419_caca_5dd21395aaa0["__unstable__loadDesignSystem()"]
  10dd1778_d5d6_7419_caca_5dd21395aaa0 -->|calls| 119395eb_05ee_4deb_739d_387fb03df2bf
  ea789d23_3858_8a34_0348_844d1438286e["resolveCssId()"]
  119395eb_05ee_4deb_739d_387fb03df2bf -->|calls| ea789d23_3858_8a34_0348_844d1438286e
  style 119395eb_05ee_4deb_739d_387fb03df2bf fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-node/src/compile.ts lines 158–175

async function loadStylesheet(
  id: string,
  base: string,
  onDependency: (path: string) => void,
  cssResolver?: Resolver,
) {
  let resolvedPath = await resolveCssId(id, base, cssResolver)
  if (!resolvedPath) throw new Error(`Could not resolve '${id}' from '${base}'`)

  onDependency(resolvedPath)

  let file = await fsPromises.readFile(resolvedPath, 'utf-8')
  return {
    path: resolvedPath,
    base: path.dirname(resolvedPath),
    content: file,
  }
}

Domain

Subdomains

Frequently Asked Questions

What does loadStylesheet() do?
loadStylesheet() is a function in the tailwindcss codebase, defined in packages/@tailwindcss-node/src/compile.ts.
Where is loadStylesheet() defined?
loadStylesheet() is defined in packages/@tailwindcss-node/src/compile.ts at line 158.
What does loadStylesheet() call?
loadStylesheet() calls 1 function(s): resolveCssId.
What calls loadStylesheet()?
loadStylesheet() is called by 2 function(s): __unstable__loadDesignSystem, createCompileOptions.

Analyze Your Own Codebase

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

Try Supermodel Free