We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
@import … source(…)
1 parent b124e83 commit 2967129Copy full SHA for 2967129
packages/tailwindcss-language-server/src/language/cssServer.ts
@@ -346,6 +346,12 @@ function createVirtualCssDocument(textDocument: TextDocument): TextDocument {
346
/@media(\s+screen\s*\([^)]+\))/g,
347
(_match, screen) => `@media (${MEDIA_MARKER})${' '.repeat(screen.length - 4)}`,
348
)
349
+ // Replace `@import "…" source()` with `@import "…"` otherwise we'll
350
+ // get warnings about expecting a semi-colon instead of the source function
351
+ .replace(
352
+ /@import\s*("(?:[^"]+)"|'(?:[^']+)')\s*source\([^)]+\)/g,
353
+ (_match, url) => `@import "${url.slice(1, -1)}"`,
354
+ )
355
.replace(/(?<=\b(?:theme|config)\([^)]*)[.[\]]/g, '_')
356
357
return TextDocument.create(
0 commit comments