since blazor doesn't support CSS isolation I found that the best way to isolate your CSS is to make a CSS file for each component you create and import it to the component .razor
file but i wanted to know that if its right to add <link rel="stylesheet" href="css/..." />
tag in top of my blazor component file ?
1
votes
1 Answers
1
votes
According to this issue: https://github.com/dotnet/aspnetcore/issues/10170 They actually plan to implement such a feature after the release of dotnet 5.0 because they are simply fully engaged with the development of the next major release. As of now there is no specification how or whether it can be done in Blazor. There are some Libraries which try to accomplish a shadow-dom like functionality. BlazorStyled
<link>
tag it's supposted to be in the_Host.cshtml
. If you want to know what's that file looks like if you visit BlazorFiddle the file that Im telling is the second file, where you're able to see<!DOCTYPE html>
. – LOL Jovem<link>
tag and im aware that it has to be there but in order to make CSS isolation it I have to add it to the component page. do you have a good suggestion on CSS isolation? – Khashayar Pakkhesal@css
block? Take a look in this issue here. – LOL Jovem