Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor CSS isolation does not work, but when I save the file, it works

$
0
0

I have this code:

razor and razor.css file tree

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:

CSS isolation does not work

but when I save the Isolation.razor.css file:

CSS isolation does work

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.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>