Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is ag-theme-balham the only ag-grid theme that works?

I added ag-grid to my Angular project. Then I imported its CSS into styles.css.

@import "~@ag-grid-community/all-modules/dist/styles/ag-grid.css";
@import "~@ag-grid-community/all-modules/dist/styles/ag-theme-balham.css";

So far, so good. The ag-theme-balham theme shows up when I run the app.

However, now I want to change the theme. But no matter which other theme's CSS I choose, no styling shows up. Even ag-theme-balham-dark doesn't work.

Verified:

  • The other themes' CSS files exist in node_modules.
  • The Angular project compiles.
  • There are no errors in the console.
like image 268
Eric Eskildsen Avatar asked Oct 17 '25 13:10

Eric Eskildsen


1 Answers

ag-grid-angular has a class attribute that you have to update as well:

<ag-grid-angular 
    *ngIf="rowData"
    style="width: 500px; height: 500px;" 
    class="ag-theme-balham"    <!-- Update this -->
    [rowData]="rowData" 
    [columnDefs]="columnDefs"
    [modules]="modules">
</ag-grid-angular>
like image 140
Eric Eskildsen Avatar answered Oct 21 '25 21:10

Eric Eskildsen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!