You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[plugin:vite-plugin-svelte] /app/src/routes/Error.svelte: Semicolon or block is expected
- Did you forget to add a lang attribute to your style tag?
- Did you forget to add a lang attribute to your style tag?
- Did you forget to add a lang attribute to your style tag?
| }
| .errors {
| @apply hover:bg-red-400;
^
| }
This seems to be a postcss-related error, since the postcss plugin is part of @tailwindcss/vite now. Maybe Vite is throwing the error before tailwind has a chance to run?
The text was updated successfully, but these errors were encountered:
Seems to also work in the Svelte Playground, so could be specific to the version(s) of related packages you're using or something specific to your project.
As an aside, Adam Wathan (creator of Tailwind) does seem to advocate avoiding @apply:
What version of Tailwind CSS are you using?
4.1.6
What build tool (or framework if it abstracts the build tool) are you using?
Svelte 4, Vite 5.4, @tailwindcss/vite 4.1.6
What operating system are you using?
For example: Windows
Describe your issue
I am using @apply inside a Svelte component, referencing my app.css file as per the docs.
This works just fine. However, as soon as you add a variant (or anything with a colon, probably), you get an error:
This seems to be a postcss-related error, since the postcss plugin is part of
@tailwindcss/vite
now. Maybe Vite is throwing the error before tailwind has a chance to run?The text was updated successfully, but these errors were encountered: