Skip to content

Instantly share code, notes, and snippets.

@MarkTechson
Last active July 5, 2021 21:07
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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