Skip to content

Use the Shadow DOM for components, isolated styles and templates #34641

@eeegs

Description

@eeegs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority:2Work that is important, but not critical for the releasearea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneneeds-prototype

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions