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 Oxide Extractor calls 12 called by 1

Entity Profile

Dependency Diagram

graph TD
  2351a59d_92ba_1342_1dcb_39b34492170e["upgradeToFullPluginSupport()"]
  2745c5e0_8ea4_a1c7_4f84_369746e3eb63["apply-compat-hooks.ts"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|defined in| 2745c5e0_8ea4_a1c7_4f84_369746e3eb63
  5701b75f_30db_85c0_f5db_cc19be325e05["applyCompatibilityHooks()"]
  5701b75f_30db_85c0_f5db_cc19be325e05 -->|calls| 2351a59d_92ba_1342_1dcb_39b34492170e
  bc7b25d3_d5ad_3609_d595_c9755dfadcbb["resolveConfig()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| bc7b25d3_d5ad_3609_d595_c9755dfadcbb
  e596f574_dab6_879c_9b4e_3aa9d2fa75d9["createCompatConfig()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| e596f574_dab6_879c_9b4e_3aa9d2fa75d9
  31653e23_464a_3652_4a48_0c82332a92c4["buildPluginApi()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| 31653e23_464a_3652_4a48_0c82332a92c4
  61e3cc2e_05f1_77a0_19e8_82b9e0fa97a8["resolveThemeValue()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| 61e3cc2e_05f1_77a0_19e8_82b9e0fa97a8
  652fb7ad_2f22_0667_c96e_43b408d0edbe["applyConfigToTheme()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| 652fb7ad_2f22_0667_c96e_43b408d0edbe
  a45cd70e_7ade_035c_2c52_6b1daff60f01["applyKeyframesToTheme()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| a45cd70e_7ade_035c_2c52_6b1daff60f01
  7bab5de5_3046_0c8a_7965_dceb4b7f277b["registerThemeVariantOverrides()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| 7bab5de5_3046_0c8a_7965_dceb4b7f277b
  8e37e8fb_aaf5_bdbd_0697_86c8bbe3e162["registerScreensConfig()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| 8e37e8fb_aaf5_bdbd_0697_86c8bbe3e162
  f0f6f497_52ca_80ac_6d1a_579038582e5b["registerContainerCompat()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| f0f6f497_52ca_80ac_6d1a_579038582e5b
  94749bfc_586d_a227_ed27_a6fae4004c50["cssContext()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| 94749bfc_586d_a227_ed27_a6fae4004c50
  2a22052d_f868_4f88_0a03_2033be58172d["styleRule()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| 2a22052d_f868_4f88_0a03_2033be58172d
  4982d9ce_98d4_85d9_44af_7cc47b93c482["walk()"]
  2351a59d_92ba_1342_1dcb_39b34492170e -->|calls| 4982d9ce_98d4_85d9_44af_7cc47b93c482
  style 2351a59d_92ba_1342_1dcb_39b34492170e 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