简体   繁体   English

如何将 aurelia slickgrid rowdetail“+”图标更改为另一个?

[英]How to change aurelia slickgrid rowdetail "+" icon to another?

I am using theaurelia-slickgrid library with the " RowDetailView " option, where we have the following icon:我正在使用带有“ RowDetailView ”选项的 aurelia-slickgrid库,其中有以下图标:

在此处输入图像描述

Is it possible to override maybe the gridOptions somewhere, or anywhere else in order to use another icon?是否可以覆盖某处或其他任何地方的 gridOptions 以使用另一个图标? Currently I am using the rowdetail options like that:目前我正在使用这样的 rowdetail 选项:

    gridOptions = {
    ....
     rowDetailView: {
    ....
    //is there something that can change the default icon?
     }

}

You can change the icons by changing any of the icons associated SASS variables .您可以通过更改与SASS 变量关联的任何图标来更改图标。 You could also use CSS Variables, see at the bottom.您还可以使用 CSS 变量,请参阅底部。

The defaults variables have the following Font-Awesome 4 icons (the hex value can be found from the Font-Awesome website), if you use a Font then you'll always have an associated Hex value:默认变量具有以下 Font-Awesome 4 图标(十六进制值可以从 Font-Awesome 网站找到),如果您使用字体,那么您将始终具有关联的十六进制值:

$slick-detail-view-icon-collapse: "\f056";
$slick-detail-view-icon-expand:   "\f055";

When you use a Font then you'll always have an Hex value (as shown above), you could use any other Font (not just Font-Awesome) but if you do then don't forget to also change the associated SASS variable (below is for Font-Awesome 4)当您使用字体时,您将始终拥有一个十六进制值(如上所示),您可以使用任何其他字体(不仅仅是 Font-Awesome),但如果您这样做,请不要忘记更改关联的 SASS 变量(下面是 Font-Awesome 4)

$slick-icon-font-family: "FontAwesome";

You can also use SVGs, that is how I created the Salesforce & Material Themes (copy SVG path from Material Design Icons ), for example您也可以使用 SVG,这就是我创建 Salesforce 和Material Themes 的方式(从Material Design Icons复制 SVG 路径),例如

$slick-detail-view-icon-collapse: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="darkgray" viewBox="0 0 24 24"><path d="M17,13H7V11H17M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"></path></svg>');
$slick-detail-view-icon-expand:   url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="darkgray" viewBox="0 0 24 24"><path d="M17,13H13V17H11V13H7V11H11V7H13V11H17M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"></path></svg>');

You could also use CSS Variables which are also available via the same name by replacing the $ prefix with --您还可以使用 CSS 变量,这些变量也可以通过将$前缀替换为--

:root {
    --slick-detail-view-icon-collapse: "\f056";
    --slick-detail-view-icon-expand: "\f055";
}

and actually I wrote all of this answer, but in fact it's also explained very well in the multiple Wikis that I created on the same topic, Styling - Wiki andSVG Icons - Wiki , so you can also check them out.实际上我写了所有这个答案,但事实上它在我创建的关于同一主题的多个 Wiki 中也有很好的解释, Styling - WikiSVG Icons - Wiki ,所以你也可以查看它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM