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
  d09344df_f73f_81c5_9800_c997f2e4f793["relativeToStylesheet()"]
  6685d9c3_9ea1_062b_c4b3_737d22eefe98["migrate-config.ts"]
  d09344df_f73f_81c5_9800_c997f2e4f793 -->|defined in| 6685d9c3_9ea1_062b_c4b3_737d22eefe98
  c87008df_39ed_c25f_fb59_02588e73a2f7["migrateConfig()"]
  c87008df_39ed_c25f_fb59_02588e73a2f7 -->|calls| d09344df_f73f_81c5_9800_c997f2e4f793
  1814a389_cfe2_00cf_bd4d_7fa2fc24143c["normalizePath()"]
  d09344df_f73f_81c5_9800_c997f2e4f793 -->|calls| 1814a389_cfe2_00cf_bd4d_7fa2fc24143c
  style d09344df_f73f_81c5_9800_c997f2e4f793 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