Skip to content

Commit 4399e1d

Browse files
author
deathaxe
committed
Update README
Resolves #3
1 parent a223508 commit 4399e1d

File tree

1 file changed

+93
-1
lines changed

1 file changed

+93
-1
lines changed

README.md

+93-1
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,106 @@ _Requires ST 4092 or higher._
2222

2323
## Usage
2424

25+
### CSS
26+
2527
This syntax is assigned to files which end with `tailwind.css` by default.
2628

27-
You need to assign it to ordinary `*.css` files manually.
29+
To use it for ordinary `*.css` files manual assignment is needed.
2830

2931
1. Click onto the syntax name in the status bar
3032
2. Navigate to the sub menu `Open all with current extension as...`
3133
3. Click on `Tailwind CSS`.
3234

35+
To add highlighting for Tailwind @-rules to CSS in a way they are also supported within component syntaxes like [Svelte](https://packagecontrol.io/packages/Svelte) or [VueJS](https://packagecontrol.io/packages/Vue%20Syntax%20Highlight)...
36+
37+
1. create a custom _Packages/User/CSS (Tailwind).sublime-syntax_
38+
2. paste the following content:
39+
40+
```yml
41+
%YAML 1.2
42+
---
43+
name: CSS (Tailwind)
44+
scope: source.css
45+
version: 2
46+
47+
extends:
48+
- Packages/Tailwind CSS/Tailwind CSS.sublime-syntax
49+
```
50+
51+
> [!WARNING]
52+
>
53+
> By assigning `source.css` main scope original PostCSS syntax is augmented.
54+
>
55+
> 1. Augmenting syntax must be loaded after CSS in order for this trick to work.
56+
> 2. Only a single augmenting syntax may exist.
57+
> 3. Syntaxes, which extend core CSS to add their own rules can't be augmented this way.
58+
59+
### PostCSS
60+
61+
To add highlighting for Tailwind @-rules to PostCSS in a way they are also supported within component syntaxes like [Svelte](https://packagecontrol.io/packages/Svelte) or [VueJS](https://packagecontrol.io/packages/Vue%20Syntax%20Highlight)...
62+
63+
1. create a custom _Packages/User/PostCSS (Tailwind).sublime-syntax_
64+
2. paste the following content:
65+
66+
```yml
67+
%YAML 1.2
68+
---
69+
name: PostCSS (Tailwind)
70+
scope: source.postcss
71+
version: 2
72+
73+
extends:
74+
- Packages/Tailwind CSS/Tailwind CSS.sublime-syntax
75+
# - ... maybe more additions
76+
- Packages/PostCSS/PostCSS.sublime-syntax
77+
```
78+
79+
> [!WARNING]
80+
>
81+
> By assigning `source.postcss` main scope original PostCSS syntax is augmented.
82+
>
83+
> 1. Augmenting syntax must be loaded after PostCSS in order for this trick to work.
84+
> 2. Only a single augmenting syntax may exist.
85+
86+
> [!NOTE]
87+
>
88+
> requires:
89+
> - [Sublime Text build 4152+](https://www.sublimetext.com/download)
90+
> - [PostCSS 3.0.0+](https://packagecontrol.io/packages/PostCSS)
91+
92+
### SCSS
93+
94+
To add highlighting for Tailwind @-rules to SCSS in a way they are also supported within component syntaxes like [Svelte](https://packagecontrol.io/packages/Svelte) or [VueJS](https://packagecontrol.io/packages/Vue%20Syntax%20Highlight)...
95+
96+
1. create a custom _Packages/User/SCSS (Tailwind).sublime-syntax_
97+
2. paste the following content:
98+
99+
```yml
100+
%YAML 1.2
101+
---
102+
name: SCSS (Tailwind)
103+
scope: source.scss
104+
version: 2
105+
106+
extends:
107+
- Packages/Tailwind CSS/Tailwind CSS.sublime-syntax
108+
# - ... maybe more additions
109+
- Packages/Sass/Syntaxes/SCSS.sublime-syntax
110+
```
111+
112+
> [!WARNING]
113+
>
114+
> By assigning `source.scss` main scope original PostCSS syntax is augmented.
115+
>
116+
> 1. Augmenting syntax must be loaded after PostCSS in order for this trick to work.
117+
> 2. Only a single augmenting syntax may exist.
118+
119+
> [!NOTE]
120+
>
121+
> requires:
122+
> - [Sublime Text build 4152+](https://www.sublimetext.com/download)
123+
> - [Sass 4.0.0+](https://packagecontrol.io/packages/PostCSS)
124+
33125
## Related Extensions
34126

35127
- [LSP-tailwindcss](https://github.com/sublimelsp/LSP-tailwindcss)

0 commit comments

Comments
 (0)