我试图在ag-grid中实现很少的自定义,例如:
有人能指出我可能的解决方案吗?
答案 0 :(得分:1)
根据docs,您可以在加载ag-grid.css
(或scss)文件和ag-theme-<themename>.css
文件之后尝试使用此CSS。在我的示例中,该主题文件适用于Balham主题ag-theme-balham.css
。该CSS会将图标从默认的黑色(使用SVG)更改为白色。
/*
* The override should be placed after the import of the theme.
* Alternatively, you can aso increase the selector's specificity.
*/
.ag-theme-balham .ag-icon-desc,
.ag-theme-balham .ag-icon-asc,
.ag-theme-balham .ag-icon-menu
{
font-family: "Font Awesome 5 Free";
/* FontAwesome uses font-weight bold */
font-weight: bold;
}
.ag-theme-balham .ag-icon-desc::before
{
content: '\f063';
color: white;
}
.ag-theme-balham .ag-icon-asc::before
{
content: '\f062';
color: white;
}
.ag-theme-balham .ag-icon-menu::before
{
content: '\f0c9';
color: white;
}
答案 1 :(得分:0)
这对我有用。只需覆盖颜色
.ag-theme-balham .ag-icon-menu:before,
.ag-theme-balham .ag-icon-asc:before,
.ag-theme-balham .ag-icon-desc:before,
.ag-theme-balham .ag-icon-filter:before{
color: #FFFFFF;
}