Blazored / Toast

A JavaScript free toast library for Blazor and Razor Component applications
https://blazored.github.io/Toast/
MIT License
654 stars 90 forks source link

[Question] No styles #219

Closed adria-arquimbau closed 1 year ago

adria-arquimbau commented 1 year ago

Please be sure to check the readme file before raising an issue.

Hi!

Seems like I made all the steps regarding configuration and the styles doesn't load correctly.

image

here is my index.html file:

`<!DOCTYPE html>

EventsManager
An unhandled error has occurred. Reload 🗙
` Regular styles in the application work correctly. All steps regarding config, `builder.Services.AddBlazoredToast();` imports: `@using Blazored.Toast @using Blazored.Toast.Services` And MainLayout: `
@Body
` Maybe a conflict within the index.html file? Thanks
taylorchasewhite commented 1 year ago

This is almost certainly going to be tied to the CSS bundling. There's a note about this in the description, here. Looks like your index.html file is missing the <link/> element that is including your bundled styles.

There's a more detailed description on bundling from Microsoft, here.

Also, note that if you're including the BlazoredToasts in a razor class library of your own (i.e. a component project that's not your main Client csproj project, you need to have at least one component that has an isolated css file associated with it in order to trigger bundling (i.e. MyComponent.razor.css) to include the BlazoredToast stylesheet in the bundled stylesheet of your own RCL.