Repository navigation
Preserve source locations for JavaScript keyframes - #20709
darrenfdes wants to merge 1 commit into
Conversation
[Medium impact] The PR appears safe to merge. Reviews (1) · Last reviewed commit: "Preserve source locations for JavaScript..." · Reviewed by Greptile |
|
No actionable comments were generated in the recent review. WalkthroughConfig resolution now tracks source locations for keyframes from base configurations and theme extensions. Compatibility hooks pass the resulting map to Severity of issue fixed: Low Merge Risk:
|
Summary
Vite's URL rewriter warns when a PostCSS declaration has no source file. In development,
@tailwindcss/postcssconverts Tailwind's AST directly to PostCSS nodes. The keyframes created from JavaScript theme configs lack source locations, so their declarations trigger the warning even when Vite suppliedfromfor the input stylesheet.Keep the source of each keyframe as configs are merged and attach it to the generated rule and its children. This gives PostCSS the source of the
@configor@plugindirective that contributed the keyframe.Related to #20452. The case reproduced here uses a JavaScript config with
theme.extend.keyframesand its matching animation utility.Test plan
mainwith missing source files and passes with this change. It covers keyframes from a base config and a separate extension config.pnpm exec vitest run --hideSkippedTestsandnode scripts/changelog.mjs check.@tailwindcss/postcssemits the configured keyframes and no longer logs the missingfromwarning.