Home / File/ apply-keyframes-to-theme.ts — tailwindcss Source File

apply-keyframes-to-theme.ts — tailwindcss Source File

Architecture documentation for apply-keyframes-to-theme.ts, a typescript file in the tailwindcss codebase. 6 imports, 3 dependents.

File typescript UpgradeToolkit TemplateAnalysis 6 imports 3 dependents 2 functions

Entity Profile

Dependency Diagram

graph LR
  0620c0e4_5f2c_149b_94e3_e0fed99b95d8["apply-keyframes-to-theme.ts"]
  42640952_ea63_55f1_1ff1_00816e2980ae["ast.ts"]
  0620c0e4_5f2c_149b_94e3_e0fed99b95d8 --> 42640952_ea63_55f1_1ff1_00816e2980ae
  f9b19679_c1f0_28d6_4d1a_31a10c52e42d["atRule"]
  0620c0e4_5f2c_149b_94e3_e0fed99b95d8 --> f9b19679_c1f0_28d6_4d1a_31a10c52e42d
  7fd72d4c_e95c_d849_1002_1e1c9d8aca1a["design-system.ts"]
  0620c0e4_5f2c_149b_94e3_e0fed99b95d8 --> 7fd72d4c_e95c_d849_1002_1e1c9d8aca1a
  c1272aed_91bb_73df_0746_d55fa9b302fd["types.ts"]
  0620c0e4_5f2c_149b_94e3_e0fed99b95d8 --> c1272aed_91bb_73df_0746_d55fa9b302fd
  af1a6ece_0432_a556_fd63_8cb4a91f12ad["plugin-api.ts"]
  0620c0e4_5f2c_149b_94e3_e0fed99b95d8 --> af1a6ece_0432_a556_fd63_8cb4a91f12ad
  e9bc21ee_17e0_ae31_b0b1_588755ffe2c6["objectToAst"]
  0620c0e4_5f2c_149b_94e3_e0fed99b95d8 --> e9bc21ee_17e0_ae31_b0b1_588755ffe2c6
  b2ba3368_7330_fe20_4543_9cafa8cfedc0["migrate-js-config.ts"]
  b2ba3368_7330_fe20_4543_9cafa8cfedc0 --> 0620c0e4_5f2c_149b_94e3_e0fed99b95d8
  daaadd53_16ee_21c6_12d9_8feaac80a91b["apply-compat-hooks.ts"]
  daaadd53_16ee_21c6_12d9_8feaac80a91b --> 0620c0e4_5f2c_149b_94e3_e0fed99b95d8
  5db58d87_3ee6_4def_7cfe_374d0849ecb5["apply-keyframes-to-theme.test.ts"]
  5db58d87_3ee6_4def_7cfe_374d0849ecb5 --> 0620c0e4_5f2c_149b_94e3_e0fed99b95d8
  style 0620c0e4_5f2c_149b_94e3_e0fed99b95d8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { atRule, type AtRule } from '../ast'
import type { DesignSystem } from '../design-system'
import type { ResolvedConfig } from './config/types'
import { objectToAst } from './plugin-api'

export function applyKeyframesToTheme(
  designSystem: DesignSystem,
  resolvedConfig: Pick<ResolvedConfig, 'theme'>,
) {
  for (let rule of keyframesToRules(resolvedConfig)) {
    designSystem.theme.addKeyframes(rule)
  }
}

export function keyframesToRules(resolvedConfig: Pick<ResolvedConfig, 'theme'>): AtRule[] {
  let rules: AtRule[] = []
  if ('keyframes' in resolvedConfig.theme) {
    for (let [name, keyframe] of Object.entries(resolvedConfig.theme.keyframes)) {
      rules.push(atRule('@keyframes', name, objectToAst(keyframe as any)))
    }
  }
  return rules
}

Subdomains

Frequently Asked Questions

What does apply-keyframes-to-theme.ts do?
apply-keyframes-to-theme.ts is a source file in the tailwindcss codebase, written in typescript. It belongs to the UpgradeToolkit domain, TemplateAnalysis subdomain.
What functions are defined in apply-keyframes-to-theme.ts?
apply-keyframes-to-theme.ts defines 2 function(s): applyKeyframesToTheme, keyframesToRules.
What does apply-keyframes-to-theme.ts depend on?
apply-keyframes-to-theme.ts imports 6 module(s): ast.ts, atRule, design-system.ts, objectToAst, plugin-api.ts, types.ts.
What files import apply-keyframes-to-theme.ts?
apply-keyframes-to-theme.ts is imported by 3 file(s): apply-compat-hooks.ts, apply-keyframes-to-theme.test.ts, migrate-js-config.ts.
Where is apply-keyframes-to-theme.ts in the architecture?
apply-keyframes-to-theme.ts is located at packages/tailwindcss/src/compat/apply-keyframes-to-theme.ts (domain: UpgradeToolkit, subdomain: TemplateAnalysis, 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