How to use scss files from NuGet package in Blazor?

Viewed 598

I have a nuget package that contains as static web assets a series of css and scss files, when I reference css files using _content/packageName/file.css I have no problem but when I try to do the same with an scss (_content/packageName/file.scss) file it doesn't find it. I need to use variables from mi nuget scss files, is there a way to access them without having to add source code to my project?

1 Answers

Quoting CSS isolation bundling:

CSS isolation occurs at build time. During this process, Blazor rewrites CSS selectors to match markup rendered by the component. These rewritten CSS styles are bundled and produced as a static asset at {PROJECT NAME}.styles.css, where the placeholder {PROJECT NAME} is the referenced package or product name.

<link href="ProjectName.styles.css" rel="stylesheet">
Related