Skip to content

Commit 4db9b32

Browse files
committed
refactor: remove duplicate theme style warnings
1 parent e462301 commit 4db9b32

Some content is hidden

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

49 files changed

+560
-830
lines changed

src/material-experimental/column-resize/_column-resize-theme.scss

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,13 @@
141141
@mixin density($theme) {}
142142

143143
@mixin theme($theme) {
144-
@include mat.private-check-duplicate-theme-styles($theme, 'mat-column-resize') {
145-
@if mat.theme-has($theme, color) {
146-
@include color($theme);
147-
}
148-
@if mat.theme-has($theme, density) {
149-
@include density($theme);
150-
}
151-
@if mat.theme-has($theme, typography) {
152-
@include typography($theme);
153-
}
144+
@if mat.theme-has($theme, color) {
145+
@include color($theme);
146+
}
147+
@if mat.theme-has($theme, density) {
148+
@include density($theme);
149+
}
150+
@if mat.theme-has($theme, typography) {
151+
@include typography($theme);
154152
}
155153
}

src/material-experimental/popover-edit/_popover-edit-theme.scss

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,13 @@
154154
@mixin density($theme) {}
155155

156156
@mixin theme($theme) {
157-
@include mat.private-check-duplicate-theme-styles($theme, 'mat-popover-edit') {
158-
@if mat.theme-has($theme, color) {
159-
@include color($theme);
160-
}
161-
@if mat.theme-has($theme, density) {
162-
@include density($theme);
163-
}
164-
@if mat.theme-has($theme, typography) {
165-
@include typography($theme);
166-
}
157+
@if mat.theme-has($theme, color) {
158+
@include color($theme);
159+
}
160+
@if mat.theme-has($theme, density) {
161+
@include density($theme);
162+
}
163+
@if mat.theme-has($theme, typography) {
164+
@include typography($theme);
167165
}
168166
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
@use '@angular/material' as mat;
22

33
@mixin theme($theme) {
4-
@include mat.private-check-duplicate-theme-styles($theme, 'mat-selection');
54
}
65

76
@mixin typography($theme) {}

src/material/_index.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323

2424
// Private/Internal
2525
@forward './core/density/private/all-density' show all-component-densities;
26-
@forward './core/theming/theming' show private-check-duplicate-theme-styles,
27-
private-legacy-get-theme, private-is-theme-object;
26+
@forward './core/theming/theming' show private-legacy-get-theme, private-is-theme-object;
2827
@forward './core/style/private' show private-theme-elevation;
2928
@forward './core/style/vendor-prefixes' as private-* show private-user-select;
3029
@forward './core/style/variables' as private-* show $private-swift-ease-in-duration,

src/material/autocomplete/_autocomplete-theme.scss

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,21 @@
5757
}
5858

5959
@mixin theme($theme) {
60-
@include theming.private-check-duplicate-theme-styles($theme, 'mat-autocomplete') {
61-
@if inspection.get-theme-version($theme) == 1 {
62-
@include base($theme);
60+
@if inspection.get-theme-version($theme) == 1 {
61+
@include base($theme);
62+
@include color($theme);
63+
@include density($theme);
64+
@include typography($theme);
65+
} @else {
66+
@include base($theme);
67+
@if inspection.theme-has($theme, color) {
6368
@include color($theme);
69+
}
70+
@if inspection.theme-has($theme, density) {
6471
@include density($theme);
72+
}
73+
@if inspection.theme-has($theme, typography) {
6574
@include typography($theme);
66-
} @else {
67-
@include base($theme);
68-
@if inspection.theme-has($theme, color) {
69-
@include color($theme);
70-
}
71-
@if inspection.theme-has($theme, density) {
72-
@include density($theme);
73-
}
74-
@if inspection.theme-has($theme, typography) {
75-
@include typography($theme);
76-
}
7775
}
7876
}
7977
}

src/material/badge/_badge-theme.scss

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,23 +87,21 @@
8787
/// @param {Map} $theme The theme to generate styles for.
8888
/// @param {String} $color-variant The color variant to use for the component
8989
@mixin theme($theme, $color-variant: null) {
90-
@include theming.private-check-duplicate-theme-styles($theme, 'mat-badge') {
91-
@if inspection.get-theme-version($theme) == 1 {
92-
@include base($theme);
93-
@include color($theme, $color-variant);
90+
@if inspection.get-theme-version($theme) == 1 {
91+
@include base($theme);
92+
@include color($theme, $color-variant);
93+
@include density($theme);
94+
@include typography($theme);
95+
} @else {
96+
@include base($theme);
97+
@if inspection.theme-has($theme, color) {
98+
@include color($theme);
99+
}
100+
@if inspection.theme-has($theme, density) {
94101
@include density($theme);
102+
}
103+
@if inspection.theme-has($theme, typography) {
95104
@include typography($theme);
96-
} @else {
97-
@include base($theme);
98-
@if inspection.theme-has($theme, color) {
99-
@include color($theme);
100-
}
101-
@if inspection.theme-has($theme, density) {
102-
@include density($theme);
103-
}
104-
@if inspection.theme-has($theme, typography) {
105-
@include typography($theme);
106-
}
107105
}
108106
}
109107
}

src/material/bottom-sheet/_bottom-sheet-theme.scss

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,23 +57,21 @@
5757
}
5858

5959
@mixin theme($theme) {
60-
@include theming.private-check-duplicate-theme-styles($theme, 'mat-bottom-sheet') {
61-
@if inspection.get-theme-version($theme) == 1 {
62-
@include base($theme);
60+
@if inspection.get-theme-version($theme) == 1 {
61+
@include base($theme);
62+
@include color($theme);
63+
@include density($theme);
64+
@include typography($theme);
65+
} @else {
66+
@include base($theme);
67+
@if inspection.theme-has($theme, color) {
6368
@include color($theme);
69+
}
70+
@if inspection.theme-has($theme, density) {
6471
@include density($theme);
72+
}
73+
@if inspection.theme-has($theme, typography) {
6574
@include typography($theme);
66-
} @else {
67-
@include base($theme);
68-
@if inspection.theme-has($theme, color) {
69-
@include color($theme);
70-
}
71-
@if inspection.theme-has($theme, density) {
72-
@include density($theme);
73-
}
74-
@if inspection.theme-has($theme, typography) {
75-
@include typography($theme);
76-
}
7775
}
7876
}
7977
}

src/material/button-toggle/_button-toggle-theme.scss

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,23 +74,21 @@
7474
/// @param {String} $color-variant: The color variant to use for the button toggle: primary,
7575
/// secondary, tertiary, or error (If not specified, default secondary color will be used).
7676
@mixin theme($theme, $color-variant: null) {
77-
@include theming.private-check-duplicate-theme-styles($theme, 'mat-button-toggle') {
78-
@if inspection.get-theme-version($theme) == 1 {
79-
@include base($theme);
80-
@include color($theme, $color-variant);
77+
@if inspection.get-theme-version($theme) == 1 {
78+
@include base($theme);
79+
@include color($theme, $color-variant);
80+
@include density($theme);
81+
@include typography($theme);
82+
} @else {
83+
@include base($theme);
84+
@if inspection.theme-has($theme, color) {
85+
@include color($theme);
86+
}
87+
@if inspection.theme-has($theme, density) {
8188
@include density($theme);
89+
}
90+
@if inspection.theme-has($theme, typography) {
8291
@include typography($theme);
83-
} @else {
84-
@include base($theme);
85-
@if inspection.theme-has($theme, color) {
86-
@include color($theme);
87-
}
88-
@if inspection.theme-has($theme, density) {
89-
@include density($theme);
90-
}
91-
@if inspection.theme-has($theme, typography) {
92-
@include typography($theme);
93-
}
9492
}
9593
}
9694
}

src/material/button/_button-theme.scss

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,23 +94,21 @@
9494
/// @param {String} $color-variant: The color variant to use for the button: primary, secondary,
9595
// tertiary, or error (If not specified, default primary color will be used).
9696
@mixin theme($theme, $color-variant: null) {
97-
@include theming.private-check-duplicate-theme-styles($theme, 'mat-button') {
98-
@if inspection.get-theme-version($theme) == 1 {
99-
@include base($theme);
100-
@include color($theme, $color-variant);
97+
@if inspection.get-theme-version($theme) == 1 {
98+
@include base($theme);
99+
@include color($theme, $color-variant);
100+
@include density($theme);
101+
@include typography($theme);
102+
} @else {
103+
@include base($theme);
104+
@if inspection.theme-has($theme, color) {
105+
@include color($theme);
106+
}
107+
@if inspection.theme-has($theme, density) {
101108
@include density($theme);
109+
}
110+
@if inspection.theme-has($theme, typography) {
102111
@include typography($theme);
103-
} @else {
104-
@include base($theme);
105-
@if inspection.theme-has($theme, color) {
106-
@include color($theme);
107-
}
108-
@if inspection.theme-has($theme, density) {
109-
@include density($theme);
110-
}
111-
@if inspection.theme-has($theme, typography) {
112-
@include typography($theme);
113-
}
114112
}
115113
}
116114
}

src/material/button/_fab-theme.scss

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,21 @@
9292
/// @param {Map} $theme The theme to generate styles for.
9393
/// @param {String} $color-variant: The color variant to use for the fab
9494
@mixin theme($theme, $color-variant: null) {
95-
@include theming.private-check-duplicate-theme-styles($theme, 'mat-fab') {
96-
@if inspection.get-theme-version($theme) == 1 {
97-
@include base($theme);
98-
@include color($theme, $color-variant);
95+
@if inspection.get-theme-version($theme) == 1 {
96+
@include base($theme);
97+
@include color($theme, $color-variant);
98+
@include density($theme);
99+
@include typography($theme);
100+
} @else {
101+
@include base($theme);
102+
@if inspection.theme-has($theme, color) {
103+
@include color($theme);
104+
}
105+
@if inspection.theme-has($theme, density) {
99106
@include density($theme);
107+
}
108+
@if inspection.theme-has($theme, typography) {
100109
@include typography($theme);
101-
} @else {
102-
@include base($theme);
103-
@if inspection.theme-has($theme, color) {
104-
@include color($theme);
105-
}
106-
@if inspection.theme-has($theme, density) {
107-
@include density($theme);
108-
}
109-
@if inspection.theme-has($theme, typography) {
110-
@include typography($theme);
111-
}
112110
}
113111
}
114112
}

0 commit comments

Comments
 (0)