C
C#4mo ago
Philip

C# Blazor CSS Isolation

I've been trying to get CSS isolation to work for ages now, and no information online seems to be working. It seems fairly straight forward when following a guide like this https://learn.microsoft.com/en-us/aspnet/core/blazor/components/css-isolation?view=aspnetcore-8.0 And does work as intended when creating a new project, but not on this project here, which I've been working on for a while: https://github.com/KNPhilip/BlazorEcommerce/tree/fix/cssHell I found out it's not necessarily the Assembly name, as stated by a lot of different posts, but rather the project id. I have been following this guide to get to the bottom of it: https://stackoverflow.com/questions/76975644/blazor-css-isolation-and-the-packageid but even that static handling of the id doesn't work either! I feel like I have no options left. Any CSS Isolation wizards here who might be able to help a feller out?
ASP.NET Core Blazor CSS isolation
Learn how CSS isolation scopes CSS to Razor components, which can simplify CSS and avoid collisions with other components or libraries.
GitHub
GitHub - KNPhilip/BlazorEcommerce at fix/cssHell
Full-Stack eCommerce application built using .NET's Blazor technology. - GitHub - KNPhilip/BlazorEcommerce at fix/cssHell
Stack Overflow
Blazor CSS Isolation and the PackageId
I am not actually detailing a problem, I am detailing a potential solution for anyone who may be interested. Firstly, I have established that to use CSS Isolation in a Blazor server application you...
3 Replies
Evyr
Evyr4mo ago
is the problematic component Error.razor ?
Evyr
Evyr4mo ago
in your WebUI.Server.csproj file there's this text, visual studio likes to add this Remove whenever you create a component for some reason
No description
Philip
PhilipOP4mo ago
Unfortunately not, it’s the same for all components..
Want results from more Discord servers?
Add your server