dotnet / dotnet/roslyn

[Blazor] Intellisense for CSS-style string parameters (such as <QuickGrid Class="..." />

Open
#85,626 5 comments 2 reactions 0 assignees View on GitHub
Area-Razor
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

In Visual Studio and other IDEs, when I type `

`, I get nice Intellisense for the `class` attribute.
I'd love to see similar Intellisense support for CSS-style Razor component parameters like ``.

### Describe the solution you'd like

Something like (+ corresponding support in IDE):

```csharp
[StringSyntax(StringSyntax.CssClass)]
[Parameter] public string? Class { get; set; }
```

This approach is already used for XML, Regex, JSON, ...

### Additional context

I'm the maintainer of [HAVIT Blazor](https://havit.blazor.eu/), and almost all our components have `CssClass` parameters (and often additional ones like `ItemCssClass`, `HeaderCssClass`, `BodyCssClass`, etc.).
It's a real pain point for our users that they don't get the same Intellisense for these parameters as they do for the standard HTML `class` attribute.
And it's definitely not just us - most component libraries have similar parameters: FluentUI, MudBlazor, you name it.

Contributor guide

Open the contributing guide

Research direction

Start by tracing the existing StringSyntax support for XML, Regex, and JSON in Roslyn, then identify the corresponding Razor and IDE handling for component parameters. Done means CSS-style parameters such as Class, CssClass, ItemCssClass, HeaderCssClass, and BodyCssClass receive CSS class IntelliSense like an HTML class attribute.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, css
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.