Home / Function/ createCompatConfig() — tailwindcss Function Reference

createCompatConfig() — tailwindcss Function Reference

Architecture documentation for the createCompatConfig() function in create-compat-config.ts from the tailwindcss codebase.

Entity Profile

Dependency Diagram

graph TD
  956ed885_5b3c_18ac_e843_dacfdbbb7845["createCompatConfig()"]
  9056089b_151f_3027_844b_242ce55294db["upgradeToFullPluginSupport()"]
  9056089b_151f_3027_844b_242ce55294db -->|calls| 956ed885_5b3c_18ac_e843_dacfdbbb7845
  3e179907_5f92_f314_14dc_f61853c74cad["get()"]
  956ed885_5b3c_18ac_e843_dacfdbbb7845 -->|calls| 3e179907_5f92_f314_14dc_f61853c74cad
  style 956ed885_5b3c_18ac_e843_dacfdbbb7845 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/tailwindcss/src/compat/config/create-compat-config.ts lines 5–63

export function createCompatConfig(cssTheme: Theme): UserConfig {
  return {
    theme: {
      ...defaultTheme,

      // In the defaultTheme config, the `colors` key is not a function but a
      // shallow object. We don't want to define the color namespace unless it
      // is in the CSS theme so here we explicitly overwrite the defaultTheme
      // and only allow colors from the CSS theme.
      colors: ({ theme }) => theme('color', {}),

      extend: {
        fontSize: ({ theme }) => ({
          ...theme('text', {}),
        }),

        boxShadow: ({ theme }) => ({
          ...theme('shadow', {}),
        }),

        animation: ({ theme }) => ({
          ...theme('animate', {}),
        }),

        aspectRatio: ({ theme }) => ({
          ...theme('aspect', {}),
        }),

        borderRadius: ({ theme }) => ({
          ...theme('radius', {}),
        }),

        screens: ({ theme }) => ({
          ...theme('breakpoint', {}),
        }),

        letterSpacing: ({ theme }) => ({
          ...theme('tracking', {}),
        }),

        lineHeight: ({ theme }) => ({
          ...theme('leading', {}),
        }),

        transitionDuration: {
          DEFAULT: cssTheme.get(['--default-transition-duration']) ?? null,
        },

        transitionTimingFunction: {
          DEFAULT: cssTheme.get(['--default-transition-timing-function']) ?? null,
        },

        maxWidth: ({ theme }) => ({
          ...theme('container', {}),
        }),
      },
    },
  }
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does createCompatConfig() do?
createCompatConfig() is a function in the tailwindcss codebase.
What does createCompatConfig() call?
createCompatConfig() calls 1 function(s): get.
What calls createCompatConfig()?
createCompatConfig() is called by 1 function(s): upgradeToFullPluginSupport.

Analyze Your Own Codebase

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

Try Supermodel Free