A Visual Studio Code extension that provides CSS class and paort name completion for the HTML class and part attribute based on the definitions found in your workspace or external files referenced through the link element.
The original extension does not support TypeScript files for some reason. At first I though about making the change and creating a pull request for the author, but when looking at the bugs and pull request for the repository, it become apparent that it's not supportet anymore. The last commit was december 2020.
- Support for .ts files
- Support for finding
partstyling in CSS files - Support for
partlookup in HTML
Original repository: https://github.com/zignd/HTML-CSS-Class-Completion
- Gives you autocompletion for CSS class and part definitions that can be found in your workspace (defined in CSS files or the in the file types listed in the Supported Language Modes section);
- Supports external stylesheets referenced through
linkelements in HTML files; - Command to manually re-cache the class definitions used in the autocompletion;
- User Settings to override which folders and files should be considered or excluded from the caching process.
- HTML
- Razor
- PHP
- Laravel (Blade)
- JavaScript
- TypeScript (.ts)
- JavaScript React (.jsx)
- TypeScript React (.tsx)
- Vue (.vue) [requires octref.vetur]
- Twig
- Markdown (.md)
- Embedded Ruby (.html.erb) [requires rebornix.Ruby]
- Handlebars
- EJS (.ejs)
- Django template (django-html)
It's possible to specify which language modes will have autocompletion. There are three settings for this feature:
html-css-class-completion.HTMLLanguagesis for language modes based on HTML, the ones you have theclassattribute;html-css-class-completion.CSSLanguagescurrently is for languages like CSS, Sass and Scss, this one is not very useful right now because it only supports the@applyfunction;html-css-class-completion.JavaScriptLanguagesis for JavaScript based languages supporting theclassorclassNameattribute.
The language modes listed in the previous section are already defined as default values in these settings, and you can add new ones or remove the already defined ones as necessary.
- "@apply" directive in CSS, SASS and SCSS Files for Tailwind CSS;
- "className" and "class" in TypeScript React, JavaScript and JavaScript React language modes;
- Emmet abbreviations support triggered by typing a "." (comes disabled by default, check the User Settings topic for more information).
You can request new features and contribute to the extension development on its repository on GitHub. 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
- Support for .ts files
- Support for finding
partstyling in CSS files - Support for
partlookup in HTML
- Settings to allow users to specify which language modes will have autocompletion;
- Fix interpretation of classes defined inside media queries.
Check out the changelog for the current and previous updates.
If there are HTML or JS files on your workspace, the extension automatically starts and looks for CSS class definitions. In case new CSS classes are defined, or new CSS files are added to the workspace, and you also want auto-completion for them, just hit the lightning icon on the status bar. Also, you can execute the command by pressing Ctrl+Shift+P(Cmd+Shift+P for Mac) and then typing "Cache CSS class definitions."
The extension supports a few user settings, changes to these settings will be automatically recognized and the caching process will be re-executed.
You can change the folders and files the extension will consider or exclude during the caching process by setting the following user settings:
"html-css-class-completion.includeGlobPattern"(default:"**/*.{css,html}")"html-css-class-completion.excludeGlobPattern"(default:"")
Emmet support comes disabled by default, the reason behind this choice is because it the current implementation simply triggers completion when you type a "." (period) and this behavior might be considered a little annoying, but it might change in the future.
Currently it supports the following languages (those are language identifier): "html", "razor", "php", "blade", "vue", "twig", "markdown", "erb", "handlebars", "ejs", "typescriptreact", "javascript", "typescript", "javascriptreact".
"html-css-class-completion.enableEmmetSupport"(default:false)


