Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: move mat-elevation-* classes out of core #29766

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/dev-app/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ $candy-app-theme: mat.m2-define-light-theme((
// have to load a single css file for Angular Material in your app.
// **Be sure that you only ever include this mixin once!**
@include mat.core();
@include mat.elevation-classes();
wagnermaciel marked this conversation as resolved.
Show resolved Hide resolved

// Include the default theme styles.
@include mat.all-component-themes($candy-app-theme);
Expand Down
2 changes: 1 addition & 1 deletion src/material/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@forward './core/style/validation' as private-*;

// Structural
@forward './core/core' show core;
@forward './core/core' show core, elevation-classes;
@forward './core/ripple/ripple' show ripple;
@forward './core/focus-indicators/private' show strong-focus-indicators,
strong-focus-indicators-color, strong-focus-indicators-theme;
Expand Down
7 changes: 7 additions & 0 deletions src/material/core/_core.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@
@include token-utils.create-token-slot(background-color, background-color, transparent);
@include token-utils.create-token-slot(color, text-color, inherit);
}
}
}
}

// Mixin that provides the .mat-elevation-* classes.
@mixin elevation-classes() {
@at-root {
@include token-utils.use-tokens(tokens-mat-app.$prefix, tokens-mat-app.get-token-slots()) {
// Provides external CSS classes for each elevation value. Each CSS class is formatted as
// `mat-elevation-z$z-value` where `$z-value` corresponds to the z-space to which the element
// is elevated.
Expand Down
Loading