Skip to content

Commit 5748a53

Browse files
committed
@apply support in CSS, SASS and SCSS Files for Tailwind CSS
Tailwind is a new CSS Framework which uses custom CSS tags through PostCss. The `@apply` syntax is used to trigger the intellisense.
1 parent f28e8d7 commit 5748a53

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ A Visual Studio Code extension that provides CSS class name completion for the H
2424
* Handlebars
2525
* EJS (.ejs)
2626

27+
## Library Specific Support
28+
* @apply in CSS, SASS and SCSS Files for [Tailwind CSS](https://tailwindcss.com)
29+
2730
## Contributions
2831
You can request new features and/or contribute to the extension development on its [repository on GitHub](https://github.com/Zignd/HTML-CSS-Class-Completion/issues). Look for an issue you're interested in working on, comment on it to let me know you're working on it and submit your pull request! :D
2932

src/extension.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,12 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
132132
context.subscriptions.push(provideCompletionItemsGenerator(extension, /class=["|']([\w- ]*$)/));
133133
});
134134

135+
// CSS based extensions
136+
['css', 'sass', 'scss'].forEach((extension) => {
137+
// Support for Tailwind CSS
138+
context.subscriptions.push(provideCompletionItemsGenerator(extension, /@apply ([\w- ]*$)/), true);
139+
});
140+
135141
caching = true;
136142
try {
137143
await cache();

0 commit comments

Comments
 (0)