dotnet / dotnet/aspnetcore

Use the Shadow DOM for components, isolated styles and templates

Open
#34,641 13 comments 12 reactions 0 assignees View on GitHub
area-blazor enhancement needs-prototype Priority:2
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is your feature request related to a problem? Please describe.
This is not a solution to a problem, but a request to change the architecture of the generated razor DOM elements. At a high level there seems to be a very high degree of correlation in the architectural concepts being provided by Blazor and the Shadow DOM, so why fight it.

### Describe the solution you'd like
Have the Razor components actually generate templates, uses slots and define themselves as shadow DOM elements using javascript classes extending HTMLElement. This would then allow css encapsulation too. Of cause you could start out by defining a class BlazorComponent: HTMLElement.

### Additional context
Nope - I suspect you get the idea.
Might also help the work on allowing interaction with other javascript frameworks. #32352.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.