Skip to content

refactor: remove unused m2 mixins #31166

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

Merged
merged 1 commit into from
May 21, 2025
Merged
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
13 changes: 0 additions & 13 deletions src/material/autocomplete/_m2-autocomplete.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@use '../core/tokens/m2-utils';
@use '../core/theming/inspection';
@use '../core/style/elevation';
@use '../core/style/sass-utils';

// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
Expand All @@ -28,14 +26,3 @@
@function get-density-tokens($theme) {
@return ();
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
13 changes: 0 additions & 13 deletions src/material/badge/_m2-badge.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
@use 'sass:map';
@use 'sass:math';
@use 'sass:color';
@use '../core/tokens/m2-utils';
@use '../core/theming/inspection';
@use '../core/style/sass-utils';

$_default-size: 22px;
$_small-size: $_default-size - 6px;
Expand Down Expand Up @@ -94,14 +92,3 @@ $_large-size: $_default-size + 6px;
@function get-density-tokens($theme) {
@return ();
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
13 changes: 0 additions & 13 deletions src/material/bottom-sheet/_m2-bottom-sheet.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@use '../core/tokens/m2-utils';
@use '../core/theming/inspection';
@use '../core/style/sass-utils';

// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
Expand Down Expand Up @@ -37,14 +35,3 @@
@function get-density-tokens($theme) {
@return ();
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
12 changes: 0 additions & 12 deletions src/material/button-toggle/_m2-button-toggle.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@use 'sass:map';
@use 'sass:meta';
@use '../core/tokens/m2-utils';
@use '../core/theming/theming';
@use '../core/theming/inspection';
@use '../core/style/sass-utils';
Expand Down Expand Up @@ -103,14 +102,3 @@
button-toggle-height: map.get($size-scale, $density-scale)
);
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
12 changes: 0 additions & 12 deletions src/material/button/_m2-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
@use '../core/tokens/m2-utils';
@use '../core/theming/theming';
@use '../core/theming/inspection';
@use '../core/style/sass-utils';
@use '../core/style/elevation';

// Tokens that can't be configured through Angular Material's current theming API,
Expand Down Expand Up @@ -238,14 +237,3 @@
button-tonal-touch-target-display: $touch-target-display,
);
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
12 changes: 0 additions & 12 deletions src/material/button/_m2-fab.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
@use '../core/tokens/m2-utils';
@use '../core/theming/theming';
@use '../core/theming/inspection';
@use '../core/style/sass-utils';
@use '../core/style/elevation';

// Tokens that can't be configured through Angular Material's current theming API,
Expand Down Expand Up @@ -117,14 +116,3 @@
fab-touch-target-display: if($density-scale < -1, none, block),
);
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
13 changes: 0 additions & 13 deletions src/material/button/_m2-icon-button.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
@use 'sass:meta';
@use 'sass:map';
@use '../core/tokens/m2-utils';
@use '../core/theming/theming';
@use '../core/theming/inspection';
@use '../core/style/sass-utils';

// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
Expand Down Expand Up @@ -71,14 +69,3 @@

@return $tokens;
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
13 changes: 0 additions & 13 deletions src/material/card/_m2-card.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@use '../core/tokens/m2-utils';
@use '../core/theming/inspection';
@use '../core/style/sass-utils';
@use '../core/style/elevation';

// Tokens that can't be configured through Angular Material's current theming API,
Expand Down Expand Up @@ -50,14 +48,3 @@
@function get-density-tokens($theme) {
@return ();
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
11 changes: 0 additions & 11 deletions src/material/checkbox/_m2-checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,3 @@
), $scale)
);
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
13 changes: 0 additions & 13 deletions src/material/chips/_m2-chip.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
@use 'sass:map';
@use 'sass:meta';
@use 'sass:color';
@use '../core/tokens/m2-utils';
@use '../core/theming/inspection';
@use '../core/style/sass-utils';
@use '../core/m2/palette' as m2-palette;
@use '../core/theming/theming';

Expand Down Expand Up @@ -110,14 +108,3 @@
)
);
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
13 changes: 0 additions & 13 deletions src/material/core/_m2-app.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@use 'sass:map';
@use './tokens/m2-utils';
@use './theming/inspection';
@use './style/sass-utils';
@use './style/elevation';

// Tokens that can't be configured through Angular Material's current theming API,
Expand Down Expand Up @@ -36,14 +34,3 @@
@function get-density-tokens($theme) {
@return ();
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
13 changes: 0 additions & 13 deletions src/material/core/option/_m2-optgroup.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@use '../style/sass-utils';
@use '../theming/inspection';
@use '../tokens/m2-utils';

// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
Expand Down Expand Up @@ -30,14 +28,3 @@
@function get-density-tokens($theme) {
@return ();
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
13 changes: 0 additions & 13 deletions src/material/core/option/_m2-option.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@use '../tokens/m2-utils';
@use '../theming/inspection';
@use '../style/sass-utils';

// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
Expand Down Expand Up @@ -38,14 +36,3 @@
@function get-density-tokens($theme) {
@return ();
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
13 changes: 0 additions & 13 deletions src/material/core/ripple/_m2-ripple.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@use 'sass:meta';
@use '../tokens/m2-utils';
@use '../theming/inspection';
@use '../style/sass-utils';

// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
Expand Down Expand Up @@ -33,14 +31,3 @@
@function get-density-tokens($theme) {
@return ();
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@use '../../tokens/m2-utils';
@use '../../theming/inspection';
@use '../../style/sass-utils';

// Tokens that can't be configured through Angular Material's current theming API,
// but may be in a future version of the theming API.
Expand Down Expand Up @@ -37,14 +35,3 @@
@function get-density-tokens($theme) {
@return ();
}

// Combines the tokens generated by the above functions into a single map with placeholder values.
// This is used to create token slots.
@function get-token-slots() {
@return sass-utils.deep-merge-all(
get-unthemable-tokens(),
get-color-tokens(m2-utils.$placeholder-color-config),
get-typography-tokens(m2-utils.$placeholder-typography-config),
get-density-tokens(m2-utils.$placeholder-density-config)
);
}
43 changes: 0 additions & 43 deletions src/material/core/tokens/_m2-utils.scss
Original file line number Diff line number Diff line change
@@ -1,53 +1,10 @@
@use '../m2/palette';
@use '../m2/theming';
@use '../m2/typography';
@use 'sass:color';
@use 'sass:math';
@use 'sass:meta';

$_placeholder-color-palette: theming.define-palette(palette.$red-palette);

// Indicates whether we're building internally. Used for backwards compatibility.
$private-is-internal-build: false;

// Placeholder color config that can be passed to token getter functions when generating token
// slots.
$placeholder-color-config: (
primary: $_placeholder-color-palette,
accent: $_placeholder-color-palette,
warn: $_placeholder-color-palette,
is-dark: false,
foreground: palette.$light-theme-foreground-palette,
background: palette.$light-theme-background-palette,
);

$_placeholder-typography-level-config: typography.typography-config-level-from-mdc(body1);

// Placeholder typography config that can be passed to token getter functions when generating token
// slots.
$placeholder-typography-config: (
font-family: 'Roboto, sans-serif',
headline-1: $_placeholder-typography-level-config,
headline-2: $_placeholder-typography-level-config,
headline-3: $_placeholder-typography-level-config,
headline-4: $_placeholder-typography-level-config,
headline-5: $_placeholder-typography-level-config,
headline-6: $_placeholder-typography-level-config,
subtitle-1: $_placeholder-typography-level-config,
subtitle-2: $_placeholder-typography-level-config,
body-1: $_placeholder-typography-level-config,
body-2: $_placeholder-typography-level-config,
caption: $_placeholder-typography-level-config,
button: $_placeholder-typography-level-config,
overline: $_placeholder-typography-level-config,
subheading-1: $_placeholder-typography-level-config,
title: $_placeholder-typography-level-config,
);

// Placeholder density config that can be passed to token getter functions when generating token
// slots.
$placeholder-density-config: 0;

/// Inherited function from MDC that computes which contrast tone to use on top of a color.
/// This is used only in a narrow set of use cases when generating M2 button tokens to maintain
/// backwards compatibility.
Expand Down
Loading
Loading