Home / File/ create-compat-config.ts — tailwindcss Source File

create-compat-config.ts — tailwindcss Source File

Architecture documentation for create-compat-config.ts, a typescript file in the tailwindcss codebase. 3 imports, 1 dependents.

File typescript OxideEngine Scanner 3 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  834afcdc_4770_404f_cd35_c37419fcda33["create-compat-config.ts"]
  80295787_127f_69e6_91b3_4bea3a484544["theme.ts"]
  834afcdc_4770_404f_cd35_c37419fcda33 --> 80295787_127f_69e6_91b3_4bea3a484544
  1b5321a5_0fcc_2351_1f22_0d4bed4c097e["default-theme.ts"]
  834afcdc_4770_404f_cd35_c37419fcda33 --> 1b5321a5_0fcc_2351_1f22_0d4bed4c097e
  c1272aed_91bb_73df_0746_d55fa9b302fd["types.ts"]
  834afcdc_4770_404f_cd35_c37419fcda33 --> c1272aed_91bb_73df_0746_d55fa9b302fd
  daaadd53_16ee_21c6_12d9_8feaac80a91b["apply-compat-hooks.ts"]
  daaadd53_16ee_21c6_12d9_8feaac80a91b --> 834afcdc_4770_404f_cd35_c37419fcda33
  style 834afcdc_4770_404f_cd35_c37419fcda33 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { Theme } from '../../theme'
import defaultTheme from '../default-theme'
import type { UserConfig } from './types'

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

Frequently Asked Questions

What does create-compat-config.ts do?
create-compat-config.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the OxideEngine domain, Scanner subdomain.
What functions are defined in create-compat-config.ts?
create-compat-config.ts defines 1 function(s): createCompatConfig.
What does create-compat-config.ts depend on?
create-compat-config.ts imports 3 module(s): default-theme.ts, theme.ts, types.ts.
What files import create-compat-config.ts?
create-compat-config.ts is imported by 1 file(s): apply-compat-hooks.ts.
Where is create-compat-config.ts in the architecture?
create-compat-config.ts is located at packages/tailwindcss/src/compat/config/create-compat-config.ts (domain: OxideEngine, subdomain: Scanner, directory: packages/tailwindcss/src/compat/config).

Analyze Your Own Codebase

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

Try Supermodel Free