You have to define your theme and include DikeGrid's mixins and Angular Material's mixins in your application.
Defining a theme
You have to create your primary and accent palettes with an optional warm palette when defining a theme. Once you have the palettes, you can create a light or a dark theme.
@use"@angular/material"as mat;@use"@dikesoft/angular-data-grid"as dkg;// The core mixin must be included exactly once for your application:@include mat.core();// The "warn" palette is optional:$primary: mat.define-palette(mat.$indigo-palette);$accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);// You can define a dark theme as well:$theme: mat.define-light-theme((color: ( primary: $primary, accent: $accent )));// Emit styles for all Angular components:@include mat.all-component-themes($theme);// Emit style for the DikeGrid component:@include dkg.theme($theme);
Customizing typography
You can also provide your typography specifications when defining a theme.
@use"@angular/material"as mat;@use"@dikesoft/angular-data-grid"as dkg;// The core mixin must be included exactly once for your application:@include mat.core();// Define a custom typography:$custom-typography: mat.define-typography-config( $font-family: Open Sans, $title: mat.define-typography-level(1.25rem,2rem,600), $body-2: mat.define-typography-level(0.875rem,1.5rem,600), $button: mat.define-typography-level(0.875rem,0.875rem,500), $input: mat.define-typography-level(0.875rem,1,400));// The "warn" palette is optional:$primary: mat.define-palette(mat.$indigo-palette);$accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);// You can define a dark theme as well:$theme: mat.define-light-theme((color: ( primary: $primary, accent: $accent ), typography: $custom-typography));// Emit styles for all Angular components:@include mat.all-component-themes($theme);// Emit style for the DikeGrid component:@include dkg.theme($theme);
DikeGrid includes four pre-built themes CSS files. Each of them uses the same palettes as Angular Material pre-built themes.
Theme
Scheme
Palettes
deeppurple-amber.css
Light
deep-purple, amber, red
indigo-pink.css
Light
indigo, pink, red
pink-bluegrey.css
Dark
pink, bluegrey, red
purple-green.css
Dark
purple, green, red
You can add the DikeGrid styles in two ways: importing the CSS file directly in the styles.scss file or adding the entry in the styles array from the angular.json file.
Importing the CSS file
Open the styles.scss file and add the following line:
When providing the mentioned Injection Token, the DikeGrid shows the default scrollbars.
Summary
Since the DikeGrid bases its theming process on the Angular Material's theming system is very easy to customize your DikeGrid instances because you are familiar with that process.