In my case, it is used "ag-grid-enterprise": "^23.1.0" and "ag-grid-community": "^23.1.0" and for creating a custom theme for angular2+ application you should import to global style file(scss is in use for my case) several mixins file from ag-grid-community package and it will look like this:
@import '~ag-grid-community/src/styles/ag-grid';
@import '~ag-grid-community/src/styles/ag-theme-base/sass/ag-theme-base';
then you should include base theme with parameters set that you can override for this default theme:
.ag-theme-base {
@include ag-theme-base(
(
foreground-color: black,
background-color: yellow,
)
);
}
List of the ag-grid parameters you can find link
Also, you can extract this parameter and apply for other elements(not sure that it is a useful option but ag-grid allows this)
.ag-header-cell {
background-color: ag-param(foreground-color);
color: ag-param(background-color);
}
Link to documentation about ag-param function link.
Link to documentation regarding theme customization link.
Example of usage in angular:
<ag-grid-angular
style="width: 100%; height: 400px;"
class="ag-theme-base"
...
>
</ag-grid-angular>