Home / Function/ migrateContents() — tailwindcss Function Reference

migrateContents() — tailwindcss Function Reference

Architecture documentation for the migrateContents() function in migrate.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd["migrateContents()"]
  1b01e45d_833e_6383_5278_3a005469d916["migrate()"]
  1b01e45d_833e_6383_5278_3a005469d916 -->|calls| b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd
  d7062e64_c90e_b85d_7355_db6c443e36d0["migrate()"]
  d7062e64_c90e_b85d_7355_db6c443e36d0 -->|calls| b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd
  d4d75164_04a2_fe3d_f794_9dd61fac1980["fromString()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| d4d75164_04a2_fe3d_f794_9dd61fac1980
  22885c03_eded_5619_af73_329b957dad5a["migrateImport()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| 22885c03_eded_5619_af73_329b957dad5a
  03d4ca08_7ec2_689c_47d8_1be20f931aa5["migrateAtApply()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| 03d4ca08_7ec2_689c_47d8_1be20f931aa5
  677923aa_e54a_b77d_277a_4252209aff18["migrateMediaScreen()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| 677923aa_e54a_b77d_277a_4252209aff18
  7d6792f7_5502_3830_e013_3fc18ce0e216["migrateVariantsDirective()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| 7d6792f7_5502_3830_e013_3fc18ce0e216
  2ec0ecaf_3c01_fcc3_d0f0_05dbeae5f6e0["migrateAtLayerUtilities()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| 2ec0ecaf_3c01_fcc3_d0f0_05dbeae5f6e0
  750de917_02a7_4958_9148_77485207558a["migrateMissingLayers()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| 750de917_02a7_4958_9148_77485207558a
  2aaf5161_ac26_f74e_9d1a_9d3e64f884b9["migrateTailwindDirectives()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| 2aaf5161_ac26_f74e_9d1a_9d3e64f884b9
  3429a735_792d_b47b_671d_373ee445fc14["migrateConfig()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| 3429a735_792d_b47b_671d_373ee445fc14
  a3f66598_fbf6_c4e3_9350_55626482e7b1["migratePreflight()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| a3f66598_fbf6_c4e3_9350_55626482e7b1
  b5d4b5a0_3713_0a6e_7e28_5aabce2dc697["migrateThemeToVar()"]
  b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd -->|calls| b5d4b5a0_3713_0a6e_7e28_5aabce2dc697
  style b1aa79a5_bad0_a9e2_1c70_8e14489ee8dd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/@tailwindcss-upgrade/src/codemods/css/migrate.ts lines 35–57

export async function migrateContents(
  stylesheet: Stylesheet | string,
  options: MigrateOptions,
  file?: string,
) {
  if (typeof stylesheet === 'string') {
    stylesheet = await Stylesheet.fromString(stylesheet)
    stylesheet.file = file ?? null
  }

  return postcss()
    .use(migrateImport())
    .use(migrateAtApply(options))
    .use(migrateMediaScreen(options))
    .use(migrateVariantsDirective())
    .use(migrateAtLayerUtilities(stylesheet))
    .use(migrateMissingLayers())
    .use(migrateTailwindDirectives(options))
    .use(migrateConfig(stylesheet, options))
    .use(migratePreflight(options))
    .use(migrateThemeToVar(options))
    .process(stylesheet.root, { from: stylesheet.file ?? undefined })
}

Subdomains

Called By

Frequently Asked Questions

What does migrateContents() do?
migrateContents() is a function in the tailwindcss codebase.
What does migrateContents() call?
migrateContents() calls 11 function(s): fromString, migrateAtApply, migrateAtLayerUtilities, migrateConfig, migrateImport, migrateMediaScreen, migrateMissingLayers, migratePreflight, and 3 more.
What calls migrateContents()?
migrateContents() is called by 2 function(s): migrate, migrate.

Analyze Your Own Codebase

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

Try Supermodel Free