Skip to content

Instantly share code, notes, and snippets.

@tomastrajan
Last active May 31, 2017 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomastrajan/37c7edf82f80332a35301bd414d4c416 to your computer and use it in GitHub Desktop.
Save tomastrajan/37c7edf82f80332a35301bd414d4c416 to your computer and use it in GitHub Desktop.
Angular Material Theming - custom components
@import '~@angular/material/theming';
@include mat-core();
@import 'my-theme.scss';
// import custom componenet themes
// unofficial naming convention to support nice ordering of files in IDE
// to see theme under the original style file of the componenent
@import 'app/shared/big-input/big-input.component.scss-theme';
@import 'app/shared/flip-toggle-button/flip-toggle-button.component.scss-theme';
// you only have to add additional componenets here (instead of in every theme class)
@mixin custom-components-theme($theme) {
@include big-input-theme($theme);
@include flip-toggle-button-theme($theme);
}
.default-theme {
@include angular-material-theme($my-theme);
// include custom components theme mixin once per theme class
@include custom-components-theme($my-theme);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment