Skip to content

Commit d5490f6

Browse files
authored
(docs) how to integrate TailwindCSS (#479)
Fixes #182, #461
1 parent d910fef commit d5490f6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Do you want to use TypeScript/SCSS/Less/..? See [Using with preprocessors](#usin
1313
#### Language specific setup
1414

1515
- [SCSS/Less](./preprocessors/scss-less.md)
16+
- [Other CSS languages, TailwindCSS](./preprocessors/other-css-preprocessors.md)
1617
- [TypeScript](./preprocessors/typescript.md)
1718

1819
## Documenting components
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Using other CSS-languages than CSS/Less/SCSS
2+
3+
The svelte-language-server and therefore the VSCode extension can only handle CSS/Less/SCSS syntax. To get other syntaxes working, read on.
4+
5+
## TailwindCSS
6+
7+
We assume you already have setup TailwindCSS within your Svelte project. If not, [this article](https://dev.to/inalbant/a-simpler-way-to-add-tailwindcss-to-your-svelte-project-11ja) and [this article](https://dev.to/sarioglu/using-svelte-with-tailwindcss-a-better-approach-47ph) explain two approaches on how to do it.
8+
9+
To use TailwindCSS with the VSCode extension:
10+
11+
1. Install the [Tailwind CSS VSCode extension](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss)
12+
2. Either add `lang="postcss"` to each of your `<style>` tags where you plan on using the Tailwind CSS directives such as `@apply`, or disable CSS diagnostics completely by adding `"svelte.plugin.css.diagnostics.enable": false` within your settings. If you still want diagnostics, install the [Stylelint VSCode extension](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint) and [configure it accordingly](https://andrich.me/vscode-stylelint-tailwind-css-are-love)

0 commit comments

Comments
 (0)