Skip to content

A Visual Studio 2022 extension, that improvies the exisiting intellisense of css classes for html-like languages.

License

Notifications You must be signed in to change notification settings

kevin-mueller/HtmlCssClassCompletion

Repository files navigation

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:

  • Works in any project type.
  • Scans CSS files in the entire project structure, including referenced projects, as well as nuget packages.
  • External CSS files, which are linked via the <link> attribute in any .html/.cshtml file, will be scanned as well.
  • Isolated CSS support. CSS classes from *.razor.css files, will only be shown in the corresponding *.razor component.

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. :)

About

A Visual Studio 2022 extension, that improvies the exisiting intellisense of css classes for html-like languages.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages