Skip to content

Instantly share code, notes, and snippets.

@MarkTechson
Last active July 5, 2021 21:07
Show Gist options
  • Save MarkTechson/6283b6a3b353f9e38964af0740e29280 to your computer and use it in GitHub Desktop.
Save MarkTechson/6283b6a3b353f9e38964af0740e29280 to your computer and use it in GitHub Desktop.
Example of the USE Syntax
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
// Here's an example of the before and after.
// BEFORE
@import '~@angular/material/theming;
@include mat-core();
$primary: mat-palette($mat-indigo);
$accent: mat-palette($mat-pink);
$theme: mat-light-theme((
color: (
primary: $primary,
accent: $accent
)
));
@include angular-material-theme($theme);
// AFTER
@use '~@angular/material' as mat;
@include mat.core();
$primary: mat.define-palette(palette.$indigo-palette);
$accent: mat.define-palette(palette.$pink-palette);
$theme: mat.define-light-theme((
color: (
primary: $primary,
accent: $accent
)
));
@include mat.all-component-themes($theme);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment