Skip to content

Commit 8f6ab61

Browse files
andrewseguinAndrew Seguin
and
Andrew Seguin
authored
refactor: remove unused m2 mixins (#31166)
Co-authored-by: Andrew Seguin <[email protected]>
1 parent 9d27352 commit 8f6ab61

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+0
-561
lines changed

src/material/autocomplete/_m2-autocomplete.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
@use '../core/tokens/m2-utils';
21
@use '../core/theming/inspection';
32
@use '../core/style/elevation';
4-
@use '../core/style/sass-utils';
53

64
// Tokens that can't be configured through Angular Material's current theming API,
75
// but may be in a future version of the theming API.
@@ -28,14 +26,3 @@
2826
@function get-density-tokens($theme) {
2927
@return ();
3028
}
31-
32-
// Combines the tokens generated by the above functions into a single map with placeholder values.
33-
// This is used to create token slots.
34-
@function get-token-slots() {
35-
@return sass-utils.deep-merge-all(
36-
get-unthemable-tokens(),
37-
get-color-tokens(m2-utils.$placeholder-color-config),
38-
get-typography-tokens(m2-utils.$placeholder-typography-config),
39-
get-density-tokens(m2-utils.$placeholder-density-config)
40-
);
41-
}

src/material/badge/_m2-badge.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
@use 'sass:map';
33
@use 'sass:math';
44
@use 'sass:color';
5-
@use '../core/tokens/m2-utils';
65
@use '../core/theming/inspection';
7-
@use '../core/style/sass-utils';
86

97
$_default-size: 22px;
108
$_small-size: $_default-size - 6px;
@@ -94,14 +92,3 @@ $_large-size: $_default-size + 6px;
9492
@function get-density-tokens($theme) {
9593
@return ();
9694
}
97-
98-
// Combines the tokens generated by the above functions into a single map with placeholder values.
99-
// This is used to create token slots.
100-
@function get-token-slots() {
101-
@return sass-utils.deep-merge-all(
102-
get-unthemable-tokens(),
103-
get-color-tokens(m2-utils.$placeholder-color-config),
104-
get-typography-tokens(m2-utils.$placeholder-typography-config),
105-
get-density-tokens(m2-utils.$placeholder-density-config)
106-
);
107-
}

src/material/bottom-sheet/_m2-bottom-sheet.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@use '../core/tokens/m2-utils';
21
@use '../core/theming/inspection';
3-
@use '../core/style/sass-utils';
42

53
// Tokens that can't be configured through Angular Material's current theming API,
64
// but may be in a future version of the theming API.
@@ -37,14 +35,3 @@
3735
@function get-density-tokens($theme) {
3836
@return ();
3937
}
40-
41-
// Combines the tokens generated by the above functions into a single map with placeholder values.
42-
// This is used to create token slots.
43-
@function get-token-slots() {
44-
@return sass-utils.deep-merge-all(
45-
get-unthemable-tokens(),
46-
get-color-tokens(m2-utils.$placeholder-color-config),
47-
get-typography-tokens(m2-utils.$placeholder-typography-config),
48-
get-density-tokens(m2-utils.$placeholder-density-config)
49-
);
50-
}

src/material/button-toggle/_m2-button-toggle.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@use 'sass:map';
22
@use 'sass:meta';
3-
@use '../core/tokens/m2-utils';
43
@use '../core/theming/theming';
54
@use '../core/theming/inspection';
65
@use '../core/style/sass-utils';
@@ -103,14 +102,3 @@
103102
button-toggle-height: map.get($size-scale, $density-scale)
104103
);
105104
}
106-
107-
// Combines the tokens generated by the above functions into a single map with placeholder values.
108-
// This is used to create token slots.
109-
@function get-token-slots() {
110-
@return sass-utils.deep-merge-all(
111-
get-unthemable-tokens(),
112-
get-color-tokens(m2-utils.$placeholder-color-config),
113-
get-typography-tokens(m2-utils.$placeholder-typography-config),
114-
get-density-tokens(m2-utils.$placeholder-density-config)
115-
);
116-
}

src/material/button/_m2-button.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
@use '../core/tokens/m2-utils';
44
@use '../core/theming/theming';
55
@use '../core/theming/inspection';
6-
@use '../core/style/sass-utils';
76
@use '../core/style/elevation';
87

98
// Tokens that can't be configured through Angular Material's current theming API,
@@ -238,14 +237,3 @@
238237
button-tonal-touch-target-display: $touch-target-display,
239238
);
240239
}
241-
242-
// Combines the tokens generated by the above functions into a single map with placeholder values.
243-
// This is used to create token slots.
244-
@function get-token-slots() {
245-
@return sass-utils.deep-merge-all(
246-
get-unthemable-tokens(),
247-
get-color-tokens(m2-utils.$placeholder-color-config),
248-
get-typography-tokens(m2-utils.$placeholder-typography-config),
249-
get-density-tokens(m2-utils.$placeholder-density-config)
250-
);
251-
}

src/material/button/_m2-fab.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
@use '../core/tokens/m2-utils';
33
@use '../core/theming/theming';
44
@use '../core/theming/inspection';
5-
@use '../core/style/sass-utils';
65
@use '../core/style/elevation';
76

87
// Tokens that can't be configured through Angular Material's current theming API,
@@ -117,14 +116,3 @@
117116
fab-touch-target-display: if($density-scale < -1, none, block),
118117
);
119118
}
120-
121-
// Combines the tokens generated by the above functions into a single map with placeholder values.
122-
// This is used to create token slots.
123-
@function get-token-slots() {
124-
@return sass-utils.deep-merge-all(
125-
get-unthemable-tokens(),
126-
get-color-tokens(m2-utils.$placeholder-color-config),
127-
get-typography-tokens(m2-utils.$placeholder-typography-config),
128-
get-density-tokens(m2-utils.$placeholder-density-config)
129-
);
130-
}

src/material/button/_m2-icon-button.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
@use 'sass:meta';
22
@use 'sass:map';
3-
@use '../core/tokens/m2-utils';
43
@use '../core/theming/theming';
54
@use '../core/theming/inspection';
6-
@use '../core/style/sass-utils';
75

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

7270
@return $tokens;
7371
}
74-
75-
// Combines the tokens generated by the above functions into a single map with placeholder values.
76-
// This is used to create token slots.
77-
@function get-token-slots() {
78-
@return sass-utils.deep-merge-all(
79-
get-unthemable-tokens(),
80-
get-color-tokens(m2-utils.$placeholder-color-config),
81-
get-typography-tokens(m2-utils.$placeholder-typography-config),
82-
get-density-tokens(m2-utils.$placeholder-density-config)
83-
);
84-
}

src/material/card/_m2-card.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@use '../core/tokens/m2-utils';
21
@use '../core/theming/inspection';
3-
@use '../core/style/sass-utils';
42
@use '../core/style/elevation';
53

64
// Tokens that can't be configured through Angular Material's current theming API,
@@ -50,14 +48,3 @@
5048
@function get-density-tokens($theme) {
5149
@return ();
5250
}
53-
54-
// Combines the tokens generated by the above functions into a single map with placeholder values.
55-
// This is used to create token slots.
56-
@function get-token-slots() {
57-
@return sass-utils.deep-merge-all(
58-
get-unthemable-tokens(),
59-
get-color-tokens(m2-utils.$placeholder-color-config),
60-
get-typography-tokens(m2-utils.$placeholder-typography-config),
61-
get-density-tokens(m2-utils.$placeholder-density-config)
62-
);
63-
}

src/material/checkbox/_m2-checkbox.scss

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,3 @@
9898
), $scale)
9999
);
100100
}
101-
102-
// Combines the tokens generated by the above functions into a single map with placeholder values.
103-
// This is used to create token slots.
104-
@function get-token-slots() {
105-
@return sass-utils.deep-merge-all(
106-
get-unthemable-tokens(),
107-
get-color-tokens(m2-utils.$placeholder-color-config),
108-
get-typography-tokens(m2-utils.$placeholder-typography-config),
109-
get-density-tokens(m2-utils.$placeholder-density-config)
110-
);
111-
}

src/material/chips/_m2-chip.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
@use 'sass:map';
22
@use 'sass:meta';
33
@use 'sass:color';
4-
@use '../core/tokens/m2-utils';
54
@use '../core/theming/inspection';
6-
@use '../core/style/sass-utils';
75
@use '../core/m2/palette' as m2-palette;
86
@use '../core/theming/theming';
97

@@ -110,14 +108,3 @@
110108
)
111109
);
112110
}
113-
114-
// Combines the tokens generated by the above functions into a single map with placeholder values.
115-
// This is used to create token slots.
116-
@function get-token-slots() {
117-
@return sass-utils.deep-merge-all(
118-
get-unthemable-tokens(),
119-
get-color-tokens(m2-utils.$placeholder-color-config),
120-
get-typography-tokens(m2-utils.$placeholder-typography-config),
121-
get-density-tokens(m2-utils.$placeholder-density-config)
122-
);
123-
}

src/material/core/_m2-app.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
@use 'sass:map';
2-
@use './tokens/m2-utils';
32
@use './theming/inspection';
4-
@use './style/sass-utils';
53
@use './style/elevation';
64

75
// Tokens that can't be configured through Angular Material's current theming API,
@@ -36,14 +34,3 @@
3634
@function get-density-tokens($theme) {
3735
@return ();
3836
}
39-
40-
// Combines the tokens generated by the above functions into a single map with placeholder values.
41-
// This is used to create token slots.
42-
@function get-token-slots() {
43-
@return sass-utils.deep-merge-all(
44-
get-unthemable-tokens(),
45-
get-color-tokens(m2-utils.$placeholder-color-config),
46-
get-typography-tokens(m2-utils.$placeholder-typography-config),
47-
get-density-tokens(m2-utils.$placeholder-density-config)
48-
);
49-
}

src/material/core/option/_m2-optgroup.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@use '../style/sass-utils';
21
@use '../theming/inspection';
3-
@use '../tokens/m2-utils';
42

53
// Tokens that can't be configured through Angular Material's current theming API,
64
// but may be in a future version of the theming API.
@@ -30,14 +28,3 @@
3028
@function get-density-tokens($theme) {
3129
@return ();
3230
}
33-
34-
// Combines the tokens generated by the above functions into a single map with placeholder values.
35-
// This is used to create token slots.
36-
@function get-token-slots() {
37-
@return sass-utils.deep-merge-all(
38-
get-unthemable-tokens(),
39-
get-color-tokens(m2-utils.$placeholder-color-config),
40-
get-typography-tokens(m2-utils.$placeholder-typography-config),
41-
get-density-tokens(m2-utils.$placeholder-density-config)
42-
);
43-
}

src/material/core/option/_m2-option.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@use '../tokens/m2-utils';
21
@use '../theming/inspection';
3-
@use '../style/sass-utils';
42

53
// Tokens that can't be configured through Angular Material's current theming API,
64
// but may be in a future version of the theming API.
@@ -38,14 +36,3 @@
3836
@function get-density-tokens($theme) {
3937
@return ();
4038
}
41-
42-
// Combines the tokens generated by the above functions into a single map with placeholder values.
43-
// This is used to create token slots.
44-
@function get-token-slots() {
45-
@return sass-utils.deep-merge-all(
46-
get-unthemable-tokens(),
47-
get-color-tokens(m2-utils.$placeholder-color-config),
48-
get-typography-tokens(m2-utils.$placeholder-typography-config),
49-
get-density-tokens(m2-utils.$placeholder-density-config)
50-
);
51-
}

src/material/core/ripple/_m2-ripple.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
@use 'sass:meta';
2-
@use '../tokens/m2-utils';
32
@use '../theming/inspection';
4-
@use '../style/sass-utils';
53

64
// Tokens that can't be configured through Angular Material's current theming API,
75
// but may be in a future version of the theming API.
@@ -33,14 +31,3 @@
3331
@function get-density-tokens($theme) {
3432
@return ();
3533
}
36-
37-
// Combines the tokens generated by the above functions into a single map with placeholder values.
38-
// This is used to create token slots.
39-
@function get-token-slots() {
40-
@return sass-utils.deep-merge-all(
41-
get-unthemable-tokens(),
42-
get-color-tokens(m2-utils.$placeholder-color-config),
43-
get-typography-tokens(m2-utils.$placeholder-typography-config),
44-
get-density-tokens(m2-utils.$placeholder-density-config)
45-
);
46-
}

src/material/core/selection/pseudo-checkbox/_m2-pseudo-checkbox.scss

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
@use '../../tokens/m2-utils';
21
@use '../../theming/inspection';
3-
@use '../../style/sass-utils';
42

53
// Tokens that can't be configured through Angular Material's current theming API,
64
// but may be in a future version of the theming API.
@@ -37,14 +35,3 @@
3735
@function get-density-tokens($theme) {
3836
@return ();
3937
}
40-
41-
// Combines the tokens generated by the above functions into a single map with placeholder values.
42-
// This is used to create token slots.
43-
@function get-token-slots() {
44-
@return sass-utils.deep-merge-all(
45-
get-unthemable-tokens(),
46-
get-color-tokens(m2-utils.$placeholder-color-config),
47-
get-typography-tokens(m2-utils.$placeholder-typography-config),
48-
get-density-tokens(m2-utils.$placeholder-density-config)
49-
);
50-
}

src/material/core/tokens/_m2-utils.scss

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,10 @@
1-
@use '../m2/palette';
2-
@use '../m2/theming';
3-
@use '../m2/typography';
41
@use 'sass:color';
52
@use 'sass:math';
63
@use 'sass:meta';
74

8-
$_placeholder-color-palette: theming.define-palette(palette.$red-palette);
9-
105
// Indicates whether we're building internally. Used for backwards compatibility.
116
$private-is-internal-build: false;
127

13-
// Placeholder color config that can be passed to token getter functions when generating token
14-
// slots.
15-
$placeholder-color-config: (
16-
primary: $_placeholder-color-palette,
17-
accent: $_placeholder-color-palette,
18-
warn: $_placeholder-color-palette,
19-
is-dark: false,
20-
foreground: palette.$light-theme-foreground-palette,
21-
background: palette.$light-theme-background-palette,
22-
);
23-
24-
$_placeholder-typography-level-config: typography.typography-config-level-from-mdc(body1);
25-
26-
// Placeholder typography config that can be passed to token getter functions when generating token
27-
// slots.
28-
$placeholder-typography-config: (
29-
font-family: 'Roboto, sans-serif',
30-
headline-1: $_placeholder-typography-level-config,
31-
headline-2: $_placeholder-typography-level-config,
32-
headline-3: $_placeholder-typography-level-config,
33-
headline-4: $_placeholder-typography-level-config,
34-
headline-5: $_placeholder-typography-level-config,
35-
headline-6: $_placeholder-typography-level-config,
36-
subtitle-1: $_placeholder-typography-level-config,
37-
subtitle-2: $_placeholder-typography-level-config,
38-
body-1: $_placeholder-typography-level-config,
39-
body-2: $_placeholder-typography-level-config,
40-
caption: $_placeholder-typography-level-config,
41-
button: $_placeholder-typography-level-config,
42-
overline: $_placeholder-typography-level-config,
43-
subheading-1: $_placeholder-typography-level-config,
44-
title: $_placeholder-typography-level-config,
45-
);
46-
47-
// Placeholder density config that can be passed to token getter functions when generating token
48-
// slots.
49-
$placeholder-density-config: 0;
50-
518
/// Inherited function from MDC that computes which contrast tone to use on top of a color.
529
/// This is used only in a narrow set of use cases when generating M2 button tokens to maintain
5310
/// backwards compatibility.

0 commit comments

Comments
 (0)