I have attempted to include the following code in my main.scss file:
@import '~ag-grid-community/src/styles/ag-grid';
@import '~ag-grid-community/src/styles/ag-theme-balham/sass/ag-theme-balham';
@import '~ag-grid-community/src/styles/ag-theme-balham-dark/sass/ag-theme-balham-dark';
My intention is to conditionally apply either ag-theme-balham
or ag-theme-balham-dark
to the div containing ag-grid.
However, when both themes are loaded through SCSS, it appears that one overrides the other due to them building on some common theme files with variables. As a result, my grid ends up being light even though I can see in the Chrome inspector that the surrounding div has the class "ag-theme-balham-dark"
, despite being imported last.
If I remove the import of the light theme first, I am able to achieve a dark grid successfully.
Switching to ag-grid's CSS rather than SCSS does work, but the whole purpose of using SCSS was to be able to override certain theme variables.