How to add different CSS files to different layouts in blazor?
You can use the HTML <link>
tag anywhere in the <head>
or <body>
to include CSS, so drop the appropriate <link rel="stylesheet" href="..." />
into MainLayout.razor and AdminLayout.razor, respectively.
Eventually, adding content to the <head>
directly from a razor component may be supported, as tracked here.