Skip to content

Commit e9a1937

Browse files
committed
Add diagnostic for @tailwind components / screens / variants
1 parent c7062cd commit e9a1937

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/tailwindcss-language-service/src/diagnostics/getInvalidTailwindDirectiveDiagnostics.ts

+7
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ function validateLayerName(
8181
return null
8282
}
8383

84+
// `@tailwind components | screens | variants` do not exist in v4
85+
if (layerName === 'components' || layerName === 'screens' || layerName === 'variants') {
86+
return {
87+
message: `'@tailwind ${layerName}' is no longer available in v4. Use '@tailwind utilities' instead.`,
88+
suggestions: [],
89+
}
90+
}
8491
let parts = layerName.split(/\s+/)
8592

8693
// `@tailwind utilities source(…)` is valid

0 commit comments

Comments
 (0)