Skip to content

Instantly share code, notes, and snippets.

// define your alternative colors, similar way to the default theme
...
// Create the theme object (a Sass map containing all of the palettes).
$alt-theme: mat-dark-theme($dark-primary, $dark-accent, $dark-warn);
.theme-dark {
@include angular-material-theme($my-app-theme);
}
@ryzy
ryzy / md-theme.scss
Last active June 30, 2018 17:03
Angular Material themes - structure
@include mat-core($typography-config = null):
- angular-material-typography():
- mat-base-typography()
- mat-autocomplete-typography()
- mat-button-typography()
- mat-card-typography()
- mat-form-field-typography()
- mat-table-typography()
- ...
- mat-ripple() // basic styling for ripple effects
@ryzy
ryzy / spec.ts
Created August 24, 2020 10:57
isTextContext
describe('#isTestContext', () => {
beforeEach(() => {
delete process.env.JEST_WORKER_ID;
delete (window as any).__karma__;
delete (window as any).Cypress;
});
it('#isTestContext should be true for Jest', () => {
expect(isTestContext()).toBe(false);
process.env.JEST_WORKER_ID = '1';
expect(isTestContext()).toBe(true);