Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS from Blazor Component Lib not loaded

I want to use my customs CSS located on the wwwroot/css/. in my BlazorControllers/Components/. files but nothing is loaded at execution. Is there something to specify in the client or in the lib project settings ?

My Library project is BlazorControllers and I use the component of the library in the Client project

enter image description here

like image 604
yToxide Avatar asked Jan 26 '23 11:01

yToxide


1 Answers

In your Index.html (or _Host.cshtml) file, below the site.css line, add

<link href="_content/<YourLibrary>/styles.css" rel="stylesheet" />

where <YourLibrary> seems to be BlazorControllers in your case.

And when I read that picture right you (also) need

<link href="_content/BlazorControllers/css/MyComponents.css" rel="stylesheet" />
like image 118
Henk Holterman Avatar answered Feb 07 '23 10:02

Henk Holterman