var toastModel = new ToastModel
{
Title = "Mot de passe",
Content = "Votre nouveau mot de passe a été enregistré avec succès.",
CssClass="e-toast-success",
Icon = "fad fa-check",
ShowCloseButton = true,
Timeout = 0
};
|
<head>
<link rel="stylesheet" rel='nofollow' href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head> |
|
<SfToast ID="toast_default" @ref="ToastObj" Title="Adaptive Tiles Meeting" Content="@ToastContent" Timeout="5000" Icon="fa fa-check">
<ToastPosition X="@ToastPosition"></ToastPosition>
</SfToast> |
If you look closely at the screenshot I shared, you will see that fontawesome is referenced correctly and that is not the problem.
As I indicated in my thread the problem is the systematic presence of the CSS class "e-icons" in the "ICON" part which systematically overloads the font used with that of Syncfusion.
I found a solution for now. But I don't think it's elegant and it's just a patch to cover up a problem that shouldn't be there.
<SfToast @ref="Application.Toast">
<ToastPosition X="@PositionX" Y="@PositionY"></ToastPosition>
</SfToast>
<script>
.fa-duotone, .fad {
position: relative;
font-family: "Font Awesome 6 Duotone" !important;
font-weight: 900;
letter-spacing: normal;
}
</script>
By adding this information in the page that instantiates SfToast, I manage to overload e-icons and allow the icon to be displayed.
In my case, I added these lines of code in MainLayout.razor in my BLAZOR application.
But once again, it's an inelegant patch that forces style elements directly into the pages, thus making application maintenance less efficient.
|
<head>
<link rel='nofollow' href="_content/Syncfusion.Blazor/styles/bootstrap4.css" rel="stylesheet" />
<link rel="stylesheet" rel='nofollow' href=https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css>
</head> |