When overriding the default identity UI in a Blazor Wasm project the layout of the site is messed up.
To reproduce create a new AspNet hosted wasm project, select Individual User Accounts as authentication option.
In the generated server project right click on Areas > Add > New Scaffolded Item > Identity > Check override all files > Choose ApplicationDbContext as data context class.
At this stage the compilation will fail due to missing using Microsoft.AspNetCore.Identity; statement in RegisterConfirmation.cshtml.cs.
Add the missing statement and run the application; result is below.

How can we override the default identity UI?
After checking it further it seems that another wwwroot folder is being added in the server project after overriding the Identity files.
Removing that folder fixes the issue.
Hi
I found server project added another wwwroot after override Identity Scaffold items too. And it works after remove that. Thx a lot.
I'm able to reproduce this issue after adding the missing using directive to workaround https://github.com/dotnet/aspnetcore/issues/20016.
The Identity scaffolder adds a wwwroot folder to the Server project with the default set of styles and other assets for the default Identity UI. These styles then override the styles that come from the Client project. In particular, both the Client and Server projects end up with a css/site.css.
It appears the Identity scaffolder has some logic to decide whether to generate a wwwroot folder. For example, in a Blazor Server project a wwwroot folder already exists and content is left untouched.
A couple of options here:
Hi Dan, 2nd point feels more natural to me also. Thanks for checking this.
We'll rename the site.css in the Blazor project to avoid conflicts.