Tema predeterminado

    La versión ligera del tema Material es el tema predeterminado en Ignite UI for Angular. Para usarlo necesitas incluir eltheme mixin después delcore mixin.

    @use "igniteui-angular/theming" as *;
    
    // IMPORTANT: Prior to Ignite UI for Angular version 13 use:
    // @import '~igniteui-angular/lib/core/styles/themes/index';
    @include core();
    @include theme(
      $palette: $light-material-palette,
      $schema: $light-material-schema
    );
    
    // We can also include the Material font and font scaling
    @include typography(
      $font-family: $material-typeface,
      $type-scale: $material-type-scale
    );
    

    Material Dark Theme

    @use "igniteui-angular/theming" as *;
    
    // IMPORTANT: Prior to Ignite UI for Angular version 13 use:
    // @import '~igniteui-angular/lib/core/styles/themes/index';
    @include core();
    @include theme(
      $palette: $dark-material-palette,
      $schema: $dark-material-schema
    );
    
    @include typography(
      $font-family: $material-typeface,
      $type-scale: $material-type-scale
    );
    

    Si desea usar solo el esquema oscuro, pero con su propia paleta, debe hacer manualmente lo siguiente:

    @use "igniteui-angular/theming" as *;
    
    // IMPORTANT: Prior to Ignite UI for Angular version 13 use:
    // @import '~igniteui-angular/lib/core/styles/themes/index';
    @include core();
    
    $primary-color: #2ab759;
    $secondary-color: #f96a88;
    $surface-color: #303030;
    
    // IMPORTANT, the primary, secondary and surface colors are required
    // The $gray will ensure that all the black text, borders, etc will become a shade of white in order to be visible against a dark background
    $my-color-palette: palette(
      $primary: $primary-color,
      $secondary: $secondary-color,
      $surface: $surface-color,
      $gray: #fff,
    );
    
    @include theme($my-color-palette, $schema: $dark-schema);
    

    Como todos los componentes individuales usan por defecto$light-material-palette, si no especificas el resto de colores como $info y $error usarán sus valores predeterminados desde el$light-material-palette.

    API Overview