-
Notifications
You must be signed in to change notification settings - Fork 22
Erroneous errors with tailwind-style @ rules #47
Comments
Quick follow-up. I was able to get rid of the second and third of these issues by disabling cc diagnostics However, no clue how to get rid of the first one |
To avoid the error create module.exports = {
preprocess: {
style: async ({ content, attributes }) => {
if (attributes.type !== "text/postcss") return
return new Promise((resolve, reject) => {
resolve({ code: "", map: "" })
})
}
}
} Do not forget to add <style type="text/postcss">
.btn {
@apply font-bold py-2 px-4 rounded;
}
</style> |
Awesome, that's sorted it - thanks 👍 Have I failed to read the appropriate docs somehow or is this a bit under-documented? |
Thank you for the fix, I added it to the template to get rid of the problems. |
Looks like it doesn't work for me. Anyone else still facing the issue? |
I just cloned your repo @marcograhl . I got this |
Set |
where this file should be placed? |
In the root of your project:
|
Just putting |
i am sorry but where is this? i cannot seem to find it? |
In VS Code, Click the Cog -> Settings -> Extensions -> Svelte |
Plugin version: 0.9.1
I'm trying to use Tailwindcss '@apply' directives in a svelte <style> tag. It seems to correctly work (in that the styles correctly end up in the generated css). Here's an example snippet:
but I get the following three errors/warnings - seemingly from the Svelte VSCode plugin but it may be from the language server.
The two 'rules' on the line
@apply px-4 py-2;
seems to be the main culprit. If it's only@apply px-4;
then only the first of the three errors/warning appears.This repo (https://github.com/marcograhl/tailwindcss-svelte-starter) demonstrates the issue perfectly. Check out the file
src/Button.svelte
for the errors.The text was updated successfully, but these errors were encountered: