I'm using "CSS isolation" with Razor Pages.
I have a _Layout.cshtml and _Layout.cshtml.css. I want to apply a background color to the body. So I tried body { background-color: red }.
But that generates css with an isolation attribute, e.g. html body[b-d29f2jaemq] { background-color: red); }. The html and body tags don't have such attributes.
Is there a way to target the body tag in a CSS isolation file?
I can reproduce this problem, so this might be a bug or by design. I suggest you post this question to the ASP.NET Core GitHub repository, then the developer team will investigate it.
As a temporary workaround, you can try adding
body { background-color: red }to the site.css file in thewwwrootfolder, and add this file reference in the layout page: