kevin-mueller / HtmlCssClassCompletion

A Visual Studio 2022 extension, that improvies the exisiting intellisense of css classes for html-like languages.
MIT License
38 stars 2 forks source link
autocomplete blazor css intellisense razor visual-studio-extension

Html Css Class Completion

The existing HTML/Razor intellisense for Visual Studio has a lot of limitations. It only works if your project is a web-based project, and does not support razor class libraries. It only scans for .css files in the wwwroot directory, and it doesn't support anything fancy like the relatively new isolated CSS feature for razor components.

This extension fixes all that, by improving the existing HTML intellisense with the following features:

Visual Studio Marketplace: https://marketplace.visualstudio.com/items?itemName=KevinMueller.HtmlCssClassCompletion22

How To Use:

After installing, the extension should scan for .css files automatically once all projects and the extension are fully loaded. You can see the progress in the bottom left corner.

image

If you add new css files, you can re-scan all files by using Tools -> Scan all Projects for CSS Classes.

image

The scanning also happens automatically every time you save a .css or .html file. This behavior can be turned off in the options under Tools -> Options -> Better Razor Css Class Intellisense.

You should now be able to use the intellisense:

image

Have a feature idea / found a bug?

Feel free to create an issue in this repo. :)