如何更改toastr中的图标填充颜色

sha*_*ila 6 css styles angularjs angular-toastr

我的应用程序中显示了 toastr 成功和错误消息。我更改了背景颜色和字体颜色。我想更改消息中显示的图标颜色。我到处搜索这个,但我找不到改变图标的​​填充颜色或至少改变图标的​​方法。以下是成功消息的截图 在此输入图像描述

下面是错误消息,

在此输入图像描述

我想更改这些消息中显示的图标,更改图标的填充颜色。js文件中的代码,

.success(function(data) {
     toastr.success('Successfully Build ', 'Congratulations!', {
                        closeButton: true
                    });
}).error(function(err) {
    toastr.error('Cant Build', 'Error', {
                        closeButton: true
                    });
Run Code Online (Sandbox Code Playgroud)

在CSS中,

#toast-container > .toast-success {
    background-image: none;
    background-color: #e9e9e9;
    color: black;
}
#toast-container > .toast-error {
    background-image: none;
    background-color: #e9e9e9;
    color: red;
}
Run Code Online (Sandbox Code Playgroud)

Jea*_*eat 8

Toaster 使用背景 PNG 图像(24x24 像素)作为图标,因此您最好的选择是将其替换为您事先准备的彩色版本。

假设您准备了一个相同大小的“黑色复选标记”PNG,那么 CSS 将是:

#toast-container>.toast-success {
background-image: url(<insert here the url pointing to your new PNG>)!important;
}
Run Code Online (Sandbox Code Playgroud)

现在要创建您想要的颜色的图标,请检查 flaticon.com(或其他类似网站)。您应该能够找到免版税的图标并下载您想要的尺寸和颜色。