Home / Function/ relativeToStylesheet() — tailwindcss Function Reference

relativeToStylesheet() — tailwindcss Function Reference

Architecture documentation for the relativeToStylesheet() function in migrate-config.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  0ca5b8d3_5f4b_b978_a42f_1a4289d904b8["relativeToStylesheet()"]
  deadb2f6_312c_a055_6892_b63958628b61["migrate-config.ts"]
  0ca5b8d3_5f4b_b978_a42f_1a4289d904b8 -->|defined in| deadb2f6_312c_a055_6892_b63958628b61
  01e3d6cc_7bef_47f3_8be8_b38c34fd3653["migrateConfig()"]
  01e3d6cc_7bef_47f3_8be8_b38c34fd3653 -->|calls| 0ca5b8d3_5f4b_b978_a42f_1a4289d904b8
  df397cc3_5766_b5b5_66f1_04e0e5873574["normalizePath()"]
  0ca5b8d3_5f4b_b978_a42f_1a4289d904b8 -->|calls| df397cc3_5766_b5b5_66f1_04e0e5873574
  style 0ca5b8d3_5f4b_b978_a42f_1a4289d904b8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-upgrade/src/codemods/css/migrate-config.ts lines 94–106

function relativeToStylesheet(sheet: Stylesheet, absolute: string) {
  if (!sheet.file) throw new Error('Can not find a path for the stylesheet')

  let sheetPath = sheet.file

  let relative = path.relative(path.dirname(sheetPath), absolute)
  if (relative[0] !== '.') {
    relative = `./${relative}`
  }
  // Ensure relative is a POSIX style path since we will merge it with the
  // glob.
  return normalizePath(relative)
}

Subdomains

Called By

Frequently Asked Questions

What does relativeToStylesheet() do?
relativeToStylesheet() is a function in the tailwindcss codebase, defined in packages/@tailwindcss-upgrade/src/codemods/css/migrate-config.ts.
Where is relativeToStylesheet() defined?
relativeToStylesheet() is defined in packages/@tailwindcss-upgrade/src/codemods/css/migrate-config.ts at line 94.
What does relativeToStylesheet() call?
relativeToStylesheet() calls 1 function(s): normalizePath.
What calls relativeToStylesheet()?
relativeToStylesheet() is called by 1 function(s): migrateConfig.

Analyze Your Own Codebase

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

Try Supermodel Free