File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
packages/@tailwindcss-upgrade/src/codemods/css Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import type { Config } from '../../../../tailwindcss/src/compat/plugin-api'
55import type { DesignSystem } from '../../../../tailwindcss/src/design-system'
66import { toKeyPath } from '../../../../tailwindcss/src/utils/to-key-path'
77import * as ValueParser from '../../../../tailwindcss/src/value-parser'
8+ import * as version from '../../utils/version'
89
910// Defaults in v4
1011const DEFAULT_BORDER_COLOR = 'currentcolor'
@@ -46,6 +47,10 @@ export function migratePreflight({
4647 }
4748
4849 function migrate ( root : Root ) {
50+ // CSS for backwards compatibility with v3 should only injected in v3
51+ // projects and not v4 projects.
52+ if ( ! version . isMajor ( 3 ) ) return
53+
4954 let isTailwindRoot = false
5055 root . walkAtRules ( 'import' , ( node ) => {
5156 if (
You can’t perform that action at this time.
0 commit comments