Home / Function/ upgradeToFullPluginSupport() — tailwindcss Function Reference

upgradeToFullPluginSupport() — tailwindcss Function Reference

Architecture documentation for the upgradeToFullPluginSupport() function in apply-compat-hooks.ts from the tailwindcss codebase.

Function typescript OxideEngine Scanner calls 12 called by 1

Entity Profile

Dependency Diagram

graph TD
  1a022c10_a26e_d793_740c_267a533619c4["upgradeToFullPluginSupport()"]
  daaadd53_16ee_21c6_12d9_8feaac80a91b["apply-compat-hooks.ts"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|defined in| daaadd53_16ee_21c6_12d9_8feaac80a91b
  fb60e614_817a_db22_d8eb_2bde7cd29719["applyCompatibilityHooks()"]
  fb60e614_817a_db22_d8eb_2bde7cd29719 -->|calls| 1a022c10_a26e_d793_740c_267a533619c4
  0ed24ba5_7c39_3f5a_fdbb_f973a617a172["resolveConfig()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| 0ed24ba5_7c39_3f5a_fdbb_f973a617a172
  5076bf17_3f31_7ece_dff7_43a9f651187c["createCompatConfig()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| 5076bf17_3f31_7ece_dff7_43a9f651187c
  2efa0a66_c375_c031_24ad_1f7509bb9b14["buildPluginApi()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| 2efa0a66_c375_c031_24ad_1f7509bb9b14
  80c6b9c7_f7d5_21ff_a3e4_25ec4a08f640["resolveThemeValue()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| 80c6b9c7_f7d5_21ff_a3e4_25ec4a08f640
  9fb2cb3b_46e1_4148_c220_0e7f4519db6d["applyConfigToTheme()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| 9fb2cb3b_46e1_4148_c220_0e7f4519db6d
  f127b5d6_5f88_398b_8c62_d6852f4e9748["applyKeyframesToTheme()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| f127b5d6_5f88_398b_8c62_d6852f4e9748
  656b067d_fbc4_1c1c_fdb6_adab0f0af66c["registerThemeVariantOverrides()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| 656b067d_fbc4_1c1c_fdb6_adab0f0af66c
  0b047051_1aac_6f5b_66f3_9f154a4cba84["registerScreensConfig()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| 0b047051_1aac_6f5b_66f3_9f154a4cba84
  f59e7dd4_a3cb_6597_a215_767fbff2baf8["registerContainerCompat()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| f59e7dd4_a3cb_6597_a215_767fbff2baf8
  b50aa380_a654_a283_9fe1_91a9a42ca527["cssContext()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| b50aa380_a654_a283_9fe1_91a9a42ca527
  36be1773_d660_31ac_0b0b_88dbd7f6f7a8["styleRule()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| 36be1773_d660_31ac_0b0b_88dbd7f6f7a8
  ed78da58_8727_ad98_120c_61f35cea357a["walk()"]
  1a022c10_a26e_d793_740c_267a533619c4 -->|calls| ed78da58_8727_ad98_120c_61f35cea357a
  style 1a022c10_a26e_d793_740c_267a533619c4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/compat/apply-compat-hooks.ts lines 217–423

function upgradeToFullPluginSupport({
  designSystem,
  base,
  ast,
  sources,
  configs,
  pluginDetails,
}: {
  designSystem: DesignSystem
  base: string
  ast: AstNode[]
  sources: { base: string; pattern: string; negated: boolean }[]
  configs: {
    path: string
    base: string
    config: UserConfig
    reference: boolean
    src: SourceLocation | undefined
  }[]
  pluginDetails: {
    path: string
    base: string
    plugin: Plugin
    options: CssPluginOptions | null
    reference: boolean
    src: SourceLocation | undefined
  }[]
}) {
  let features = Features.None
  let pluginConfigs = pluginDetails.map((detail) => {
    if (!detail.options) {
      return {
        config: { plugins: [detail.plugin] },
        base: detail.base,
        reference: detail.reference,
        src: detail.src,
      }
    }

    if ('__isOptionsFunction' in detail.plugin) {
      return {
        config: { plugins: [detail.plugin(detail.options)] },
        base: detail.base,
        reference: detail.reference,
        src: detail.src,
      }
    }

    throw new Error(`The plugin "${detail.path}" does not accept options`)
  })

  let userConfig = [...pluginConfigs, ...configs]

  let { resolvedConfig } = resolveConfig(designSystem, [
    { config: createCompatConfig(designSystem.theme), base, reference: true, src: undefined },
    ...userConfig,
    { config: { plugins: [darkModePlugin] }, base, reference: true, src: undefined },
  ])
  let { resolvedConfig: resolvedUserConfig, replacedThemeKeys } = resolveConfig(
    designSystem,
    userConfig,
  )

  let pluginApiConfig = {
    designSystem,
    ast,
    resolvedConfig,
    featuresRef: {
      set current(value: number) {
        features |= value
      },
    },
  }

  let sharedPluginApi = buildPluginApi({
    ...pluginApiConfig,
    referenceMode: false,
    src: undefined,
  })

  // Replace `resolveThemeValue` with a version that is backwards compatible

Domain

Subdomains

Frequently Asked Questions

What does upgradeToFullPluginSupport() do?
upgradeToFullPluginSupport() is a function in the tailwindcss codebase, defined in packages/tailwindcss/src/compat/apply-compat-hooks.ts.
Where is upgradeToFullPluginSupport() defined?
upgradeToFullPluginSupport() is defined in packages/tailwindcss/src/compat/apply-compat-hooks.ts at line 217.
What does upgradeToFullPluginSupport() call?
upgradeToFullPluginSupport() calls 12 function(s): applyConfigToTheme, applyKeyframesToTheme, buildPluginApi, createCompatConfig, cssContext, registerContainerCompat, registerScreensConfig, registerThemeVariantOverrides, and 4 more.
What calls upgradeToFullPluginSupport()?
upgradeToFullPluginSupport() is called by 1 function(s): applyCompatibilityHooks.

Analyze Your Own Codebase

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

Try Supermodel Free