apply-compat-hooks.ts — tailwindcss Source File
Architecture documentation for apply-compat-hooks.ts, a typescript file in the tailwindcss codebase. 33 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR daaadd53_16ee_21c6_12d9_8feaac80a91b["apply-compat-hooks.ts"] 42640952_ea63_55f1_1ff1_00816e2980ae["ast.ts"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> 42640952_ea63_55f1_1ff1_00816e2980ae b50aa380_a654_a283_9fe1_91a9a42ca527["cssContext"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> b50aa380_a654_a283_9fe1_91a9a42ca527 36be1773_d660_31ac_0b0b_88dbd7f6f7a8["styleRule"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> 36be1773_d660_31ac_0b0b_88dbd7f6f7a8 2da63033_d079_7b37_5cfb_3877674a70b9["toCss"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> 2da63033_d079_7b37_5cfb_3877674a70b9 7fd72d4c_e95c_d849_1002_1e1c9d8aca1a["design-system.ts"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> 7fd72d4c_e95c_d849_1002_1e1c9d8aca1a 224e6d20_656a_4689_b56d_bc18bf3b80d9["source.ts"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> 224e6d20_656a_4689_b56d_bc18bf3b80d9 ef204000_8998_5a6c_5455_324b37624713["segment.ts"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> ef204000_8998_5a6c_5455_324b37624713 f712ed47_45d4_4e5a_dd73_fdefa1da71da["segment"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> f712ed47_45d4_4e5a_dd73_fdefa1da71da d1b39b63_c9d5_6c28_0206_0ddc8b895876["walk.ts"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> d1b39b63_c9d5_6c28_0206_0ddc8b895876 ed78da58_8727_ad98_120c_61f35cea357a["walk"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> ed78da58_8727_ad98_120c_61f35cea357a 7b34c369_d799_30f1_b751_6e3fd5349f6b["WalkAction"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> 7b34c369_d799_30f1_b751_6e3fd5349f6b 245c850a_c551_a2cf_854e_bba95b5a1339["apply-config-to-theme.ts"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> 245c850a_c551_a2cf_854e_bba95b5a1339 9fb2cb3b_46e1_4148_c220_0e7f4519db6d["applyConfigToTheme"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> 9fb2cb3b_46e1_4148_c220_0e7f4519db6d 0620c0e4_5f2c_149b_94e3_e0fed99b95d8["apply-keyframes-to-theme.ts"] daaadd53_16ee_21c6_12d9_8feaac80a91b --> 0620c0e4_5f2c_149b_94e3_e0fed99b95d8 style daaadd53_16ee_21c6_12d9_8feaac80a91b fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { Features } from '..'
import { cssContext, styleRule, toCss, type AstNode } from '../ast'
import type { DesignSystem } from '../design-system'
import type { SourceLocation } from '../source-maps/source'
import { segment } from '../utils/segment'
import { walk, WalkAction } from '../walk'
import { applyConfigToTheme } from './apply-config-to-theme'
import { applyKeyframesToTheme } from './apply-keyframes-to-theme'
import { createCompatConfig } from './config/create-compat-config'
import { resolveConfig } from './config/resolve-config'
import type { UserConfig } from './config/types'
import { registerContainerCompat } from './container'
import { darkModePlugin } from './dark-mode'
import { registerLegacyUtilities } from './legacy-utilities'
import { buildPluginApi, type CssPluginOptions, type Plugin } from './plugin-api'
import { registerScreensConfig } from './screens-config'
import { registerThemeVariantOverrides } from './theme-variants'
const IS_VALID_PREFIX = /^[a-z]+$/
export async function applyCompatibilityHooks({
designSystem,
base,
ast,
loadModule,
sources,
}: {
designSystem: DesignSystem
base: string
ast: AstNode[]
loadModule: (
path: string,
base: string,
resourceHint: 'plugin' | 'config',
) => Promise<{
path: string
base: string
module: any
}>
sources: { base: string; pattern: string; negated: boolean }[]
}) {
let features = Features.None
let pluginPaths: [
{ id: string; base: string; reference: boolean; src: SourceLocation | undefined },
CssPluginOptions | null,
][] = []
let configPaths: {
id: string
base: string
reference: boolean
src: SourceLocation | undefined
}[] = []
walk(ast, (node, _ctx) => {
if (node.kind !== 'at-rule') return
let ctx = cssContext(_ctx)
// Collect paths from `@plugin` at-rules
if (node.name === '@plugin') {
if (ctx.parent !== null) {
// ... (364 more lines)
Domain
Subdomains
Dependencies
- ..
- WalkAction
- apply-config-to-theme.ts
- apply-keyframes-to-theme.ts
- applyConfigToTheme
- applyKeyframesToTheme
- ast.ts
- buildPluginApi
- container.ts
- create-compat-config.ts
- createCompatConfig
- cssContext
- dark-mode.ts
- darkModePlugin
- design-system.ts
- legacy-utilities.ts
- plugin-api.ts
- registerContainerCompat
- registerLegacyUtilities
- registerScreensConfig
- registerThemeVariantOverrides
- resolve-config.ts
- resolveConfig
- screens-config.ts
- segment
- segment.ts
- source.ts
- styleRule
- theme-variants.ts
- toCss
- types.ts
- walk
- walk.ts
Imported By
Source
Frequently Asked Questions
What does apply-compat-hooks.ts do?
apply-compat-hooks.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the OxideEngine domain, Extractor subdomain.
What functions are defined in apply-compat-hooks.ts?
apply-compat-hooks.ts defines 2 function(s): applyCompatibilityHooks, upgradeToFullPluginSupport.
What does apply-compat-hooks.ts depend on?
apply-compat-hooks.ts imports 33 module(s): .., WalkAction, apply-config-to-theme.ts, apply-keyframes-to-theme.ts, applyConfigToTheme, applyKeyframesToTheme, ast.ts, buildPluginApi, and 25 more.
What files import apply-compat-hooks.ts?
apply-compat-hooks.ts is imported by 1 file(s): index.ts.
Where is apply-compat-hooks.ts in the architecture?
apply-compat-hooks.ts is located at packages/tailwindcss/src/compat/apply-compat-hooks.ts (domain: OxideEngine, subdomain: Extractor, directory: packages/tailwindcss/src/compat).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free