I have this code:
Isolation.razor:
@page "/css/isolation"<h3>Isolation</h3><h1>TEST</h1>Isolation.razor.css:
h1 { color: tomato;}It seems like it does not work at first in debug mode:
but when I save the Isolation.razor.css file:
I created a new Blazor project and compared it to mine, but I don't know what the problem is. It worked fine for the new project.
And I checked {ASSEMBLY NAME}.styles.css
@import '_content/Microsoft.AspNetCore.Components.QuickGrid/Microsoft.AspNetCore.Components.QuickGrid.bundle.scp.css';@import '_content/Microsoft.FluentUI.AspNetCore.Components/Microsoft.FluentUI.AspNetCore.Components.bundle.scp.css';/* _content/{ASSEMBLY NAME}/Components/Pages/Css/Isolation.razor.rz.scp.css */h1[b-n08r7a8kqo] { color: tomato;}I think it looks like it was created correctly.
I solved this by moving the existing content into a new project. It was a small project, so it made sense, but I'm still frustrated because I don't know what's causing the problem.