Skip to content

Commit 6315e79

Browse files
authored
refactor: create mixins for core classes (#29786)
* This is an intermediary step so we can roll out calls to these empty mixins progressively. * Once all of the instances of mat.core have been updated to also call mat.app-background and mat.elevation-classes we can move the styles over without breaking any clients
1 parent 49af49b commit 6315e79

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

src/dev-app/theme.scss

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ $candy-app-theme: mat.m2-define-light-theme((
2525
// have to load a single css file for Angular Material in your app.
2626
// **Be sure that you only ever include this mixin once!**
2727
@include mat.core();
28+
@include mat.app-background();
29+
@include mat.elevation-classes();
2830

2931
// Include the default theme styles.
3032
@include mat.all-component-themes($candy-app-theme);

src/material/_index.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
@forward './core/style/validation' as private-*;
3737

3838
// Structural
39-
@forward './core/core' show core;
39+
@forward './core/core' show core, app-background, elevation-classes;
4040
@forward './core/ripple/ripple' show ripple;
4141
@forward './core/focus-indicators/private' show strong-focus-indicators,
4242
strong-focus-indicators-color, strong-focus-indicators-theme;

src/material/core/_core.scss

+6
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,9 @@
4242
}
4343
}
4444
}
45+
46+
// Mixin that provides the .mat-app-background class.
47+
@mixin app-background() {}
48+
49+
// Mixin that provides the .mat-elevation-* classes.
50+
@mixin elevation-classes() {}

src/universal-app/styles.scss

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@use '@angular/material' as mat;
22

33
@include mat.core();
4+
@include mat.app-background();
45

56
$theme: mat.define-theme((
67
color: (

0 commit comments

Comments
 (0)