Home / Function/ relativeToStylesheet() — tailwindcss Function Reference

relativeToStylesheet() — tailwindcss Function Reference

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

Function typescript OxideCore Extractor calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  22f11d7f_1406_3124_fbe8_c62553e40db9["relativeToStylesheet()"]
  ae71e830_2140_5aa0_3162_84e6103a5a3e["migrateConfig()"]
  ae71e830_2140_5aa0_3162_84e6103a5a3e -->|calls| 22f11d7f_1406_3124_fbe8_c62553e40db9
  d00d78c4_d3a9_d8f8_31c1_110fc660f105["normalizePath()"]
  22f11d7f_1406_3124_fbe8_c62553e40db9 -->|calls| d00d78c4_d3a9_d8f8_31c1_110fc660f105
  style 22f11d7f_1406_3124_fbe8_c62553e40db9 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)
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does relativeToStylesheet() do?
relativeToStylesheet() is a function in the tailwindcss codebase.
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