I created a Blazor WebAssembly hosted template in .NET Core 3.1. Then right clicked on project.Client/wwwroot/css folder and clicked on Add client side library. Then selected the Font Awesome library and installed it. I added the below line to index.html <head>
.
<link href="css/font-awesome/css/fontawesome.css" rel="stylesheet"/>
I have libman.json of:
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "[email protected]",
"destination": "wwwroot/css/font-awesome/"
}
]
}
I added just the below line to the default Blazor template page Counter.razor (Razor component). The IntelliSense finds the font:
@page "/counter"
<h1>Counter</h1>
<span class="fa fa-save"></span>
@code {}
but I only see a square:
<script src="https://kit.fontawesome.com/a076d05399.js"></script>
And it works. I'm not familiar with these toys, but I guess you need to get a code like a076d05399 to enable it. I'm using here the code from a sample by w3schools. How it should be done when you use the files from wwwroot is not clear to me. – enet