Blazor server CSS isolation not working in Chrome

134 Views Asked by At

I am trying to use CSS isolation and came across a similar problem as described here - basically, my isolated styles are not applying.

However, I realized, when testing different browsers, that it works with Firefox and Edge, but not with Chrome. Is this a known limitation of Chrome? Or is there some specific code to add to make it work with Chrome?

1

There are 1 best solutions below

2
On

Manually clearing the cache worked.

Generally, it also helps to add css versioning when declaring the file, as for example

<link href="MyApplication.styles.css" rel="stylesheet" asp-append-version="true" />
<!-- it also helps for other custom css files.... -->
<link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />

Credit to this thread.