diff --git a/src/material-experimental/column-resize/_column-resize-theme.scss b/src/material-experimental/column-resize/_column-resize-theme.scss index a135eef41abe..0eb01e0522b9 100644 --- a/src/material-experimental/column-resize/_column-resize-theme.scss +++ b/src/material-experimental/column-resize/_column-resize-theme.scss @@ -141,15 +141,13 @@ @mixin density($theme) {} @mixin theme($theme) { - @include mat.private-check-duplicate-theme-styles($theme, 'mat-column-resize') { - @if mat.theme-has($theme, color) { - @include color($theme); - } - @if mat.theme-has($theme, density) { - @include density($theme); - } - @if mat.theme-has($theme, typography) { - @include typography($theme); - } + @if mat.theme-has($theme, color) { + @include color($theme); + } + @if mat.theme-has($theme, density) { + @include density($theme); + } + @if mat.theme-has($theme, typography) { + @include typography($theme); } } diff --git a/src/material-experimental/popover-edit/_popover-edit-theme.scss b/src/material-experimental/popover-edit/_popover-edit-theme.scss index cc981d875f8f..214c81d7e7a3 100644 --- a/src/material-experimental/popover-edit/_popover-edit-theme.scss +++ b/src/material-experimental/popover-edit/_popover-edit-theme.scss @@ -154,15 +154,13 @@ @mixin density($theme) {} @mixin theme($theme) { - @include mat.private-check-duplicate-theme-styles($theme, 'mat-popover-edit') { - @if mat.theme-has($theme, color) { - @include color($theme); - } - @if mat.theme-has($theme, density) { - @include density($theme); - } - @if mat.theme-has($theme, typography) { - @include typography($theme); - } + @if mat.theme-has($theme, color) { + @include color($theme); + } + @if mat.theme-has($theme, density) { + @include density($theme); + } + @if mat.theme-has($theme, typography) { + @include typography($theme); } } diff --git a/src/material-experimental/selection/_selection.scss b/src/material-experimental/selection/_selection.scss index 05457c06bcd2..379092562f25 100644 --- a/src/material-experimental/selection/_selection.scss +++ b/src/material-experimental/selection/_selection.scss @@ -1,7 +1,4 @@ -@use '@angular/material' as mat; - @mixin theme($theme) { - @include mat.private-check-duplicate-theme-styles($theme, 'mat-selection'); } @mixin typography($theme) {} diff --git a/src/material/_index.scss b/src/material/_index.scss index ad196cd60f1b..93e89c94af7d 100644 --- a/src/material/_index.scss +++ b/src/material/_index.scss @@ -23,8 +23,7 @@ // Private/Internal @forward './core/density/private/all-density' show all-component-densities; -@forward './core/theming/theming' show private-check-duplicate-theme-styles, - private-legacy-get-theme, private-is-theme-object; +@forward './core/theming/theming' show private-legacy-get-theme, private-is-theme-object; @forward './core/style/private' show private-theme-elevation; @forward './core/style/vendor-prefixes' as private-* show private-user-select; @forward './core/style/variables' as private-* show $private-swift-ease-in-duration, diff --git a/src/material/autocomplete/_autocomplete-theme.scss b/src/material/autocomplete/_autocomplete-theme.scss index 00f0c665b0b5..21c46b92c6c6 100644 --- a/src/material/autocomplete/_autocomplete-theme.scss +++ b/src/material/autocomplete/_autocomplete-theme.scss @@ -1,5 +1,4 @@ @use 'sass:map'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-autocomplete') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/badge/_badge-theme.scss b/src/material/badge/_badge-theme.scss index 160c54ce6a7e..d3df753f607f 100644 --- a/src/material/badge/_badge-theme.scss +++ b/src/material/badge/_badge-theme.scss @@ -1,5 +1,4 @@ @use '../core/theming/inspection'; -@use '../core/theming/theming'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @use './m2-badge'; @@ -87,23 +86,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-badge') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/bottom-sheet/_bottom-sheet-theme.scss b/src/material/bottom-sheet/_bottom-sheet-theme.scss index 36771bb33e5f..39e8ec2e31a2 100644 --- a/src/material/bottom-sheet/_bottom-sheet-theme.scss +++ b/src/material/bottom-sheet/_bottom-sheet-theme.scss @@ -1,6 +1,5 @@ @use 'sass:map'; @use '../core/typography/typography'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @use './m2-bottom-sheet'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-bottom-sheet') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/button-toggle/_button-toggle-theme.scss b/src/material/button-toggle/_button-toggle-theme.scss index 3fc10f3a803e..d41e22c742a8 100644 --- a/src/material/button-toggle/_button-toggle-theme.scss +++ b/src/material/button-toggle/_button-toggle-theme.scss @@ -1,5 +1,4 @@ @use '../core/theming/inspection'; -@use '../core/theming/theming'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @use './m2-button-toggle'; @@ -74,23 +73,21 @@ /// @param {String} $color-variant: The color variant to use for the button toggle: primary, /// secondary, tertiary, or error (If not specified, default secondary color will be used). @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-button-toggle') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/button/_button-theme.scss b/src/material/button/_button-theme.scss index a3a748822b0e..d57977f1b7c7 100644 --- a/src/material/button/_button-theme.scss +++ b/src/material/button/_button-theme.scss @@ -1,5 +1,4 @@ @use '../core/theming/inspection'; -@use '../core/theming/theming'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @use './m2-button'; @@ -94,23 +93,21 @@ /// @param {String} $color-variant: The color variant to use for the button: primary, secondary, // tertiary, or error (If not specified, default primary color will be used). @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-button') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/button/_fab-theme.scss b/src/material/button/_fab-theme.scss index 1207e539751f..71f6504194a3 100644 --- a/src/material/button/_fab-theme.scss +++ b/src/material/button/_fab-theme.scss @@ -1,4 +1,3 @@ -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use './m2-fab'; @use './m3-fab'; @@ -92,23 +91,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant: The color variant to use for the fab @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-fab') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/button/_icon-button-theme.scss b/src/material/button/_icon-button-theme.scss index 4803070d0b18..78dc1dffe406 100644 --- a/src/material/button/_icon-button-theme.scss +++ b/src/material/button/_icon-button-theme.scss @@ -3,7 +3,6 @@ @use './m2-icon-button'; @use './m3-icon-button'; @use '../core/tokens/token-utils'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @mixin base($theme) { @@ -125,7 +124,6 @@ /// @param {String} $color-variant: The color variant to use for the button: primary, // secondary, tertiary, or error. @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-icon-button') { @if inspection.get-theme-version($theme) == 1 { @include base($theme); @include color($theme, $color-variant); @@ -141,7 +139,6 @@ } @if inspection.theme-has($theme, typography) { @include typography($theme); - } } } } diff --git a/src/material/card/_card-theme.scss b/src/material/card/_card-theme.scss index 1c2d0d4a29fa..3213b5eeb7bc 100644 --- a/src/material/card/_card-theme.scss +++ b/src/material/card/_card-theme.scss @@ -1,5 +1,4 @@ @use 'sass:map'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-card') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/checkbox/_checkbox-theme.scss b/src/material/checkbox/_checkbox-theme.scss index 8c19a16fb3c6..c7b708ddb819 100644 --- a/src/material/checkbox/_checkbox-theme.scss +++ b/src/material/checkbox/_checkbox-theme.scss @@ -1,4 +1,3 @@ -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @@ -86,23 +85,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-checkbox') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/chips/_chips-theme.scss b/src/material/chips/_chips-theme.scss index b5e9ddcb8562..ea4242bc82a9 100644 --- a/src/material/chips/_chips-theme.scss +++ b/src/material/chips/_chips-theme.scss @@ -2,7 +2,6 @@ @use './m2-chip'; @use './m3-chip'; @use '../core/tokens/token-utils'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use 'sass:map'; @@ -96,23 +95,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-chips') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/core/_core-theme.scss b/src/material/core/_core-theme.scss index 51943133d526..82915a4d4410 100644 --- a/src/material/core/_core-theme.scss +++ b/src/material/core/_core-theme.scss @@ -1,4 +1,3 @@ -@use './theming/theming'; @use './theming/inspection'; @use './ripple/ripple-theme'; @use './option/option-theme'; @@ -106,26 +105,21 @@ // Mixin that renders all of the core styles that depend on the theme. @mixin theme($theme) { - // Wrap the sub-theme includes in the duplicate theme styles mixin. This ensures that - // there won't be multiple warnings. e.g. if `mat-core-theme` reports a warning, then - // the imported themes (such as `mat-ripple-theme`) should not report again. - @include theming.private-check-duplicate-theme-styles($theme, 'mat-core') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/core/focus-indicators/_private.scss b/src/material/core/focus-indicators/_private.scss index 3370f75d348f..82732ebbc876 100644 --- a/src/material/core/focus-indicators/_private.scss +++ b/src/material/core/focus-indicators/_private.scss @@ -2,7 +2,6 @@ @use 'sass:meta'; @use '@angular/cdk'; @use '../style/layout-common'; -@use '../theming/theming'; @use '../theming/inspection'; // Private sass variables that will be used as reference throughout component stylesheets. @@ -104,10 +103,8 @@ $default-border-radius: 4px; @include _customize-focus-indicators((border-color: $theme-or-color)); } @else { - @include theming.private-check-duplicate-theme-styles($theme-or-color, 'mat-focus-indicators') { - @if inspection.theme-has($theme-or-color, color) { - @include strong-focus-indicators-color($theme-or-color); - } + @if inspection.theme-has($theme-or-color, color) { + @include strong-focus-indicators-color($theme-or-color); } } } diff --git a/src/material/core/option/_optgroup-theme.scss b/src/material/core/option/_optgroup-theme.scss index f2c007440824..7e73385c1740 100644 --- a/src/material/core/option/_optgroup-theme.scss +++ b/src/material/core/option/_optgroup-theme.scss @@ -2,7 +2,6 @@ @use './m2-optgroup'; @use './m3-optgroup'; @use '../tokens/token-utils'; -@use '../theming/theming'; @use '../theming/inspection'; @use '../typography/typography'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-optgroup') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/core/option/_option-theme.scss b/src/material/core/option/_option-theme.scss index 6185d19ee89c..252e3e5cd080 100644 --- a/src/material/core/option/_option-theme.scss +++ b/src/material/core/option/_option-theme.scss @@ -1,7 +1,6 @@ @use './m2-option'; @use './m3-option'; @use '../tokens/token-utils'; -@use '../theming/theming'; @use '../theming/inspection'; @use '../typography/typography'; @use 'sass:map'; @@ -84,23 +83,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-option') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/core/ripple/_ripple-theme.scss b/src/material/core/ripple/_ripple-theme.scss index 5564970a8c53..a8f97700f71c 100644 --- a/src/material/core/ripple/_ripple-theme.scss +++ b/src/material/core/ripple/_ripple-theme.scss @@ -2,7 +2,6 @@ @use './m2-ripple'; @use './m3-ripple'; @use '../tokens/token-utils'; -@use '../theming/theming'; @use '../theming/inspection'; @mixin base($theme) { @@ -56,23 +55,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-ripple') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss b/src/material/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss index 6e7e7e633419..b8ff362f4007 100644 --- a/src/material/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss +++ b/src/material/core/selection/pseudo-checkbox/_pseudo-checkbox-theme.scss @@ -1,4 +1,3 @@ -@use '../../theming/theming'; @use '../../theming/inspection'; @use '../../tokens/token-utils'; @use './m2-pseudo-checkbox'; @@ -91,23 +90,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-pseudo-checkbox') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/core/theming/_all-theme.scss b/src/material/core/theming/_all-theme.scss index e3536aaf087a..3f101ef80f41 100644 --- a/src/material/core/theming/_all-theme.scss +++ b/src/material/core/theming/_all-theme.scss @@ -37,51 +37,47 @@ @use '../../snack-bar/snack-bar-theme'; @use '../../form-field/form-field-theme'; @use '../../timepicker/timepicker-theme'; -@use './theming'; // Create a theme. @mixin all-component-themes($theme) { - $dedupe-key: 'angular-material-theme'; - @include theming.private-check-duplicate-theme-styles($theme, $dedupe-key) { - @include core-theme.theme($theme); - @include card-theme.theme($theme); - @include progress-bar-theme.theme($theme); - @include tooltip-theme.theme($theme); - @include form-field-theme.theme($theme); - @include input-theme.theme($theme); - @include select-theme.theme($theme); - @include autocomplete-theme.theme($theme); - @include dialog-theme.theme($theme); - @include chips-theme.theme($theme); - @include slide-toggle-theme.theme($theme); - @include radio-theme.theme($theme); - @include slider-theme.theme($theme); - @include menu-theme.theme($theme); - @include list-theme.theme($theme); - @include paginator-theme.theme($theme); - @include tabs-theme.theme($theme); - @include checkbox-theme.theme($theme); - @include button-theme.theme($theme); - @include icon-button-theme.theme($theme); - @include fab-theme.theme($theme); - @include snack-bar-theme.theme($theme); - @include table-theme.theme($theme); - @include progress-spinner-theme.theme($theme); - @include badge-theme.theme($theme); - @include bottom-sheet-theme.theme($theme); - @include button-toggle-theme.theme($theme); - @include datepicker-theme.theme($theme); - @include divider-theme.theme($theme); - @include expansion-theme.theme($theme); - @include grid-list-theme.theme($theme); - @include icon-theme.theme($theme); - @include sidenav-theme.theme($theme); - @include stepper-theme.theme($theme); - @include sort-theme.theme($theme); - @include toolbar-theme.theme($theme); - @include tree-theme.theme($theme); - @include timepicker-theme.theme($theme); - } + @include core-theme.theme($theme); + @include card-theme.theme($theme); + @include progress-bar-theme.theme($theme); + @include tooltip-theme.theme($theme); + @include form-field-theme.theme($theme); + @include input-theme.theme($theme); + @include select-theme.theme($theme); + @include autocomplete-theme.theme($theme); + @include dialog-theme.theme($theme); + @include chips-theme.theme($theme); + @include slide-toggle-theme.theme($theme); + @include radio-theme.theme($theme); + @include slider-theme.theme($theme); + @include menu-theme.theme($theme); + @include list-theme.theme($theme); + @include paginator-theme.theme($theme); + @include tabs-theme.theme($theme); + @include checkbox-theme.theme($theme); + @include button-theme.theme($theme); + @include icon-button-theme.theme($theme); + @include fab-theme.theme($theme); + @include snack-bar-theme.theme($theme); + @include table-theme.theme($theme); + @include progress-spinner-theme.theme($theme); + @include badge-theme.theme($theme); + @include bottom-sheet-theme.theme($theme); + @include button-toggle-theme.theme($theme); + @include datepicker-theme.theme($theme); + @include divider-theme.theme($theme); + @include expansion-theme.theme($theme); + @include grid-list-theme.theme($theme); + @include icon-theme.theme($theme); + @include sidenav-theme.theme($theme); + @include stepper-theme.theme($theme); + @include sort-theme.theme($theme); + @include toolbar-theme.theme($theme); + @include tree-theme.theme($theme); + @include timepicker-theme.theme($theme); } @mixin all-component-bases($theme) { diff --git a/src/material/core/theming/_theming.scss b/src/material/core/theming/_theming.scss index e3ddff8a4d20..98a1f9cc217b 100644 --- a/src/material/core/theming/_theming.scss +++ b/src/material/core/theming/_theming.scss @@ -4,19 +4,16 @@ @use 'sass:meta'; @use 'sass:color'; +// Deprecated flag that is no longer used to control duplication warnings. +// Remove in v22 +$theme-ignore-duplication-warnings: false; + // Whether to enable compatibility with legacy methods for accessing theme information. $theme-legacy-inspection-api-compatibility: true !default; -// Whether duplication warnings should be disabled. Warnings enabled by default. -$theme-ignore-duplication-warnings: false !default; - // Whether density should be generated by default. $_generate-default-density: true !default; -// Warning that will be printed if duplicated styles are generated by a theme. -$_duplicate-warning: 'Read more about how style duplication can be avoided in a dedicated ' + - 'guide. https://v18.material.angular.dev/guide/duplicate-theming-styles'; - // Warning that will be printed if the legacy theming API is used. $private-legacy-theme-warning: 'Angular Material themes should be created from a map containing ' + 'the keys "color", "typography", and "density". The color value should be a map containing the ' + @@ -40,46 +37,6 @@ $_emitted-base: () !default; $private-internal-name: _mat-theming-internals-do-not-access; -// Checks if configurations that have been declared in the given theme have been generated -// before. If so, warnings will be reported. This should notify developers in case duplicate -// styles are accidentally generated due to wrong usage of the all-theme mixins. -// -// Additionally, this mixin controls the default value for the density configuration. By -// default, density styles are generated at scale zero. If the same density styles would be -// generated a second time though, the default value will change to avoid duplicate styles. -// -// The mixin keeps track of all configurations in a list that is scoped to the specified -// id. This is necessary because a given theme can be passed to multiple disjoint theme mixins -// (e.g. `all-component-themes` and `all-legacy-component-themes`) without causing any -// style duplication. -@mixin private-check-duplicate-theme-styles($theme-or-color-config, $id) { - // TODO(mmalerba): use get-theme-version for this check when its moved out of experimental. - @if map.get($theme-or-color-config, $private-internal-name, theme-version) == 1 { - @include _check-duplicate-theme-styles-v1($theme-or-color-config, $id) { - // Optionally, consumers of this mixin can wrap contents inside so that nested - // duplicate style checks do not report another warning. e.g. if developers include - // the `all-component-themes` mixin twice, only the top-level duplicate styles check - // should report a warning. Not all individual components should report a warning too. - $orig-mat-theme-ignore-duplication-warnings: $theme-ignore-duplication-warnings; - $theme-ignore-duplication-warnings: true !global; - @content; - $theme-ignore-duplication-warnings: $orig-mat-theme-ignore-duplication-warnings !global; - } - } - @else { - @include _check-duplicate-theme-styles-v0($theme-or-color-config, $id) { - // Optionally, consumers of this mixin can wrap contents inside so that nested - // duplicate style checks do not report another warning. e.g. if developers include - // the `all-component-themes` mixin twice, only the top-level duplicate styles check - // should report a warning. Not all individual components should report a warning too. - $orig-mat-theme-ignore-duplication-warnings: $theme-ignore-duplication-warnings; - $theme-ignore-duplication-warnings: true !global; - @content; - $theme-ignore-duplication-warnings: $orig-mat-theme-ignore-duplication-warnings !global; - } - } -} - /// Strip out any settings map entries that have empty values (null or ()). @function _strip-empty-settings($settings) { $result: (); @@ -91,131 +48,6 @@ $private-internal-name: _mat-theming-internals-do-not-access; @return if($result == (), null, $result); } -// Checks for duplicate styles in a `theme-version: 1` style theme. -@mixin _check-duplicate-theme-styles-v1($theme-or-color-config, $id) { - $color-settings: _strip-empty-settings(( - theme-type: map.get($theme-or-color-config, $private-internal-name, theme-type), - color-tokens: map.get($theme-or-color-config, $private-internal-name, color-tokens), - )); - $typography-settings: _strip-empty-settings(( - typography-tokens: - map.get($theme-or-color-config, $private-internal-name, typography-tokens), - )); - $density-settings: _strip-empty-settings(( - density-scale: - map.get($theme-or-color-config, $private-internal-name, density-scale), - density-tokens: - map.get($theme-or-color-config, $private-internal-name, density-tokens), - )); - $base-settings: _strip-empty-settings(( - base-tokens: map.get($theme-or-color-config, $private-internal-name, base-tokens), - )); - $previous-color-settings: map.get($_emitted-color, $id) or (); - $previous-typography-settings: map.get($_emitted-typography, $id) or (); - $previous-density-settings: map.get($_emitted-density, $id) or (); - $previous-base-settings: map.get($_emitted-base, $id) or (); - - // Check if the color configuration has been generated before. - @if $color-settings != null { - @if list.index($previous-color-settings, $color-settings) != null and - not $theme-ignore-duplication-warnings { - @warn 'The same color styles are generated multiple times. ' + $_duplicate-warning; - } - $previous-color-settings: list.append($previous-color-settings, $color-settings); - } - - // Check if the typography configuration has been generated before. - @if $typography-settings != null { - @if list.index($previous-typography-settings, $typography-settings) != null and - not $theme-ignore-duplication-warnings { - @warn 'The same typography styles are generated multiple times. ' + $_duplicate-warning; - } - $previous-typography-settings: list.append($previous-typography-settings, $typography-settings); - } - - // Check if the density configuration has been generated before. - @if $density-settings != null { - @if list.index($previous-density-settings, $density-settings) != null and - not $theme-ignore-duplication-warnings { - @warn 'The same density styles are generated multiple times. ' + $_duplicate-warning; - } - $previous-density-settings: list.append($previous-density-settings, $density-settings); - } - - // Check if the base configuration has been generated before. - @if $base-settings != null { - @if list.index($previous-base-settings, $base-settings) != null and - not $theme-ignore-duplication-warnings { - @warn 'The same base theme styles are generated multiple times. ' + $_duplicate-warning; - } - $previous-base-settings: list.append($previous-base-settings, $base-settings); - } - - $_emitted-color: map.set($_emitted-color, $id, $previous-color-settings) !global; - $_emitted-density: map.set($_emitted-density, $id, $previous-density-settings) !global; - $_emitted-typography: map.set($_emitted-typography, $id, $previous-typography-settings) !global; - $_emitted-base: map.set($_emitted-base, $id, $previous-base-settings) !global; - - @content; -} - -// Checks for duplicate styles in a `theme-version: 0` style theme. -@mixin _check-duplicate-theme-styles-v0($theme-or-color-config, $id) { - $theme: private-legacy-get-theme($theme-or-color-config); - $color-config: map.get($theme, $private-internal-name, m2-config, color) or - private-get-color-config($theme); - $density-config: map.get($theme, $private-internal-name, m2-config, density) or - private-get-density-config($theme); - $typography-config: map.get($theme, $private-internal-name, m2-config, typography) or - private-get-typography-config($theme); - // Lists of previous `color`, `density` and `typography` configurations. - $previous-color: map.get($_emitted-color, $id) or (); - $previous-typography: map.get($_emitted-typography, $id) or (); - $previous-density: map.get($_emitted-density, $id) or (); - // Whether duplicate legacy density styles would be generated. - $duplicate-legacy-density: false; - - // Check if the color configuration has been generated before. - @if $color-config != null { - @if list.index($previous-color, $color-config) != null and - not $theme-ignore-duplication-warnings { - @warn 'The same color styles are generated multiple times. ' + $_duplicate-warning; - } - $previous-color: list.append($previous-color, $color-config); - } - - // Check if the typography configuration has been generated before. - @if $typography-config != null { - @if list.index($previous-typography, $typography-config) != null and - not $theme-ignore-duplication-warnings { - @warn 'The same typography styles are generated multiple times. ' + $_duplicate-warning; - } - $previous-typography: list.append($previous-typography, $typography-config); - } - - // Check if the density configuration has been generated before. - @if $density-config != null { - @if list.index($previous-density, $density-config) != null { - // Only report a warning if density styles would be duplicated for non-legacy theme - // definitions. For legacy themes, we have compatibility logic that avoids duplication - // of default density styles. We don't want to report a warning in those cases. - @if private-is-legacy-constructed-theme($theme) { - $duplicate-legacy-density: true; - } - @else if not $theme-ignore-duplication-warnings { - @warn 'The same density styles are generated multiple times. ' + $_duplicate-warning; - } - } - $previous-density: list.append($previous-density, $density-config); - } - - $_emitted-color: map.merge($_emitted-color, ($id: $previous-color)) !global; - $_emitted-density: map.merge($_emitted-density, ($id: $previous-density)) !global; - $_emitted-typography: map.merge($_emitted-typography, ($id: $previous-typography)) !global; - - @content; -} - // Checks whether the given value resolves to a theme object. Theme objects are always // of type `map` and can optionally only specify `color`, `density` or `typography`. @function private-is-theme-object($value) { diff --git a/src/material/core/theming/tests/test-theming-api.scss b/src/material/core/theming/tests/test-theming-api.scss index 566992f8ceac..963c79333e92 100644 --- a/src/material/core/theming/tests/test-theming-api.scss +++ b/src/material/core/theming/tests/test-theming-api.scss @@ -9,10 +9,6 @@ @use '../theming'; @use 'sass:map'; -// Disable theme style duplication warnings. This test intentionally generates -// the same themes multiple times. -theming.$theme-ignore-duplication-warnings: true; - // A new way to configure themes has been introduced. This Sass file ensures that the theming // API is backwards compatible, so that the old pattern for configuring themes can be still // used. The Sass compilation of this file will fail if one of the tests/assertions fails. diff --git a/src/material/core/theming/tests/test-theming-bundle.scss b/src/material/core/theming/tests/test-theming-bundle.scss index 4763e52c9446..61f1191f7353 100644 --- a/src/material/core/theming/tests/test-theming-bundle.scss +++ b/src/material/core/theming/tests/test-theming-bundle.scss @@ -3,10 +3,6 @@ // with the include paths being set to the `bazel-bin` directory. @use '../../../index' as mat; -// Disable theme style duplication warnings. This test intentionally generates -// the same themes multiple times. -mat.$theme-ignore-duplication-warnings: true; - // If one of these mixins or function is not available, the compilation will fail and the // test will be reported as failing. diff --git a/src/material/core/theming/tests/theming-mixin-api.spec.ts b/src/material/core/theming/tests/theming-mixin-api.spec.ts deleted file mode 100644 index 197587ccdbf8..000000000000 --- a/src/material/core/theming/tests/theming-mixin-api.spec.ts +++ /dev/null @@ -1,270 +0,0 @@ -import {parse, Root, Rule} from 'postcss'; -import {compileString} from 'sass'; -import {runfiles} from '@bazel/runfiles'; -import * as path from 'path'; - -import {compareNodes} from '../../../../../tools/postcss/compare-nodes.js'; -import {createLocalAngularPackageImporter} from '../../../../../tools/sass/local-sass-importer.js'; - -// Note: For Windows compatibility, we need to resolve the directory paths through runfiles -// which are guaranteed to reside in the source tree. -const testDir = path.join(runfiles.resolvePackageRelative('../_all-theme.scss'), '../tests'); -const packagesDir = path.join(runfiles.resolveWorkspaceRelative('src/cdk/_index.scss'), '../..'); - -const localPackageSassImporter = createLocalAngularPackageImporter(packagesDir); - -describe('theming api', () => { - /** Map of known selectors for density styles and their corresponding AST rule. */ - let knownDensitySelectors: Map; - - // Before all tests, we collect all nodes specific to density styles. We can then - // use this check how density styles are generated. i.e. if they are properly scoped to a - // given selector. - beforeAll(() => { - knownDensitySelectors = new Map(); - parse(transpile(`@include mat.all-component-densities(0);`)).each(node => { - if (node.type === 'rule') { - node.selectors.forEach(s => knownDensitySelectors.set(s, node)); - } - }); - }); - - it('should warn if color styles are duplicated', () => { - spyOn(process.stderr, 'write'); - - transpile(` - $theme: mat.m2-define-light-theme(( - color: ( - primary: mat.m2-define-palette(mat.$m2-red-palette), - accent: mat.m2-define-palette(mat.$m2-red-palette), - ) - )); - - @include mat.all-component-themes($theme); - - .dark-theme { - @include mat.all-component-themes($theme); - } - `); - - expectWarning(/The same color styles are generated multiple times/); - }); - - it('should not warn if color styles and density are not duplicated', () => { - const parsed = parse( - transpile(` - $theme: mat.m2-define-light-theme(( - color: ( - primary: mat.m2-define-palette(mat.$m2-red-palette), - accent: mat.m2-define-palette(mat.$m2-red-palette), - ) - )); - $theme2: mat.m2-define-light-theme(( - color: ( - primary: mat.m2-define-palette(mat.$m2-red-palette), - accent: mat.m2-define-palette(mat.$m2-blue-palette), - ) - )); - - @include mat.all-component-themes($theme); - - .dark-theme { - @include mat.all-component-colors($theme2); - } - `), - ); - - expect(hasDensityStyles(parsed, null)).toBe('all'); - expect(hasDensityStyles(parsed, '.dark-theme')).toBe('none'); - expectNoWarning(/The same color styles are generated multiple times/); - }); - - it('should warn if default density styles are duplicated', () => { - spyOn(process.stderr, 'write'); - - const parsed = parse( - transpile(` - @include mat.all-component-themes((color: null)); - - .dark-theme { - @include mat.all-component-themes((color: null)); - } - `), - ); - - expect(hasDensityStyles(parsed, null)).toBe('all'); - // TODO(mmalerba): Re-enable - disabled because this test does not account - // for the fact that: - // ```scss - // @include mat.button-theme($theme); - // @include mat.checkbox-theme($theme); - // ``` - // produces different results than: - // ```scss - // html { - // @include mat.button-theme($theme); - // @include mat.checkbox-theme($theme); - // } - // ``` - // expect(hasDensityStyles(parsed, '.dark-theme')).toBe('all'); - expectWarning(/The same density styles are generated multiple times/); - }); - - it('should warn if density styles are duplicated', () => { - spyOn(process.stderr, 'write'); - - transpile(` - @include mat.all-component-themes((density: -1)); - - .dark-theme { - @include mat.all-component-themes((density: -1)); - } - `); - - expectWarning(/The same density styles are generated multiple times/); - }); - - it('should not warn if density styles are not duplicated', () => { - spyOn(process.stderr, 'write'); - - transpile(` - @include mat.all-component-themes((density: -1)); - - .dark-theme { - @include mat.all-component-themes((density: -2)); - } - `); - - expect(process.stderr.write).toHaveBeenCalledTimes(0); - }); - - it('should warn if typography styles are duplicated', () => { - spyOn(process.stderr, 'write'); - - transpile(` - $theme: (typography: mat.m2-define-typography-config(), density: null); - @include mat.all-component-themes($theme); - - .dark-theme { - @include mat.all-component-themes($theme); - } - `); - - expectWarning(/The same typography styles are generated multiple times/); - }); - - it('should not warn if typography styles are not duplicated', () => { - spyOn(process.stderr, 'write'); - - transpile(` - @include mat.all-component-themes(( - typography: mat.m2-define-typography-config(), - density: null, - )); - - .dark-theme { - @include mat.all-component-themes(( - typography: mat.m2-define-typography-config($font-family: "sans-serif"), - density: null, - )); - } - `); - - expect(process.stderr.write).toHaveBeenCalledTimes(0); - }); - - /** - * Checks whether the given parsed stylesheet contains density styles scoped to - * a given selector. If the selector is `null`, then density is expected to be - * generated at top-level. - */ - function hasDensityStyles(parsed: Root, baseSelector: string | null): 'all' | 'partial' | 'none' { - expect(parsed.nodes).withContext('Expected CSS to be not empty.').toBeDefined(); - expect(knownDensitySelectors.size).not.toBe(0); - const missingDensitySelectors = new Set(knownDensitySelectors.keys()); - const baseSelectorRegex = new RegExp(`^${baseSelector} `, 'g'); - - // Go through all rules in the stylesheet and check if they match with any - // of the density style selectors. If so, we remove it from the copied set - // of density selectors. If the set is empty at the end, we know that density - // styles have been generated as expected. - parsed.nodes!.forEach(node => { - if (node.type !== 'rule') { - return; - } - node.selectors.forEach(selector => { - if (baseSelector && selector === baseSelector) { - // Styles emitted directly to the baseSelector are emitted to html - // when there is no baseSelector. - selector = 'html'; - } else { - // Only check selectors that match the specified base selector. - if (baseSelector && !baseSelectorRegex.test(selector)) { - return; - } - } - selector = selector.replace(baseSelectorRegex, ''); - const matchingRule = knownDensitySelectors.get(selector); - if (matchingRule && compareNodes(node, matchingRule)) { - missingDensitySelectors.delete(selector); - } - }); - }); - - // If there are no unmatched density selectors, then it's confirmed that - // all density styles have been generated (scoped to the given selector). - if (missingDensitySelectors.size === 0) { - return 'all'; - } - // If no density selector has been matched at all, then no density - // styles have been generated. - if (missingDensitySelectors.size === knownDensitySelectors.size) { - return 'none'; - } - console.error('MISSING!!! ', [...missingDensitySelectors].join(',')); - return 'partial'; - } - - /** Transpiles given Sass content into CSS. */ - function transpile(content: string) { - return compileString( - ` - @use '../../../index' as mat; - - ${content} - `, - { - loadPaths: [testDir], - importers: [localPackageSassImporter], - }, - ).css.toString(); - } - - /** Expects the given warning to be reported in Sass. */ - function expectWarning(message: RegExp) { - expect(getMatchingWarning(message)) - .withContext('Expected warning to be printed.') - .toBeDefined(); - } - - /** Expects the given warning not to be reported in Sass. */ - function expectNoWarning(message: RegExp) { - expect(getMatchingWarning(message)) - .withContext('Expected no warning to be printed.') - .toBeUndefined(); - } - - /** - * Gets first instance of the given warning reported in Sass. Dart sass directly writes - * to the `process.stderr` stream, so we spy on the `stderr.write` method. We - * cannot expect a specific amount of writes as Sass calls `stderr.write` multiple - * times for a warning (e.g. spacing and stack trace) - */ - function getMatchingWarning(message: RegExp) { - const writeSpy = process.stderr.write as jasmine.Spy; - return (writeSpy.calls?.all() ?? []).find( - (s: jasmine.CallInfo) => - typeof s.args[0] === 'string' && message.test(s.args[0]), - ); - } -}); diff --git a/src/material/datepicker/_datepicker-theme.scss b/src/material/datepicker/_datepicker-theme.scss index 281ed444c356..d2972be6bf59 100644 --- a/src/material/datepicker/_datepicker-theme.scss +++ b/src/material/datepicker/_datepicker-theme.scss @@ -2,7 +2,6 @@ @use 'sass:map'; @use './m2-datepicker'; @use './m3-datepicker'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @@ -113,23 +112,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-datepicker') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/dialog/_dialog-theme.scss b/src/material/dialog/_dialog-theme.scss index 9d0157f76a23..9c6cbb9ed00a 100644 --- a/src/material/dialog/_dialog-theme.scss +++ b/src/material/dialog/_dialog-theme.scss @@ -2,7 +2,6 @@ @use './m2-dialog'; @use './m3-dialog'; @use '../core/tokens/token-utils'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-dialog') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/divider/_divider-theme.scss b/src/material/divider/_divider-theme.scss index 4090fbeca03e..8583c131428e 100644 --- a/src/material/divider/_divider-theme.scss +++ b/src/material/divider/_divider-theme.scss @@ -1,5 +1,4 @@ @use 'sass:map'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @use './m2-divider'; @@ -56,23 +55,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-divider') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/expansion/_expansion-theme.scss b/src/material/expansion/_expansion-theme.scss index c0b0f41b82d3..0a435e6142e7 100644 --- a/src/material/expansion/_expansion-theme.scss +++ b/src/material/expansion/_expansion-theme.scss @@ -1,5 +1,4 @@ @use 'sass:map'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-expansion') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/form-field/_form-field-theme.scss b/src/material/form-field/_form-field-theme.scss index 61a172eadf43..9a757e594f71 100644 --- a/src/material/form-field/_form-field-theme.scss +++ b/src/material/form-field/_form-field-theme.scss @@ -1,6 +1,5 @@ @use './m2-form-field'; @use './m3-form-field'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -77,23 +76,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-form-field') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/grid-list/_grid-list-theme.scss b/src/material/grid-list/_grid-list-theme.scss index a2fe523cba92..930d84ba2aab 100644 --- a/src/material/grid-list/_grid-list-theme.scss +++ b/src/material/grid-list/_grid-list-theme.scss @@ -1,5 +1,4 @@ @use 'sass:map'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use './m2-grid-list'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-grid-list') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/icon/_icon-theme.scss b/src/material/icon/_icon-theme.scss index 75f5621b3216..809f4f4fa4f6 100644 --- a/src/material/icon/_icon-theme.scss +++ b/src/material/icon/_icon-theme.scss @@ -1,5 +1,4 @@ @use '../core/theming/inspection'; -@use '../core/theming/theming'; @use '../core/tokens/token-utils'; @use './m2-icon'; @use './m3-icon'; @@ -92,23 +91,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-icon') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/input/_input-theme.scss b/src/material/input/_input-theme.scss index 782939b3fca4..36b7be9470ac 100644 --- a/src/material/input/_input-theme.scss +++ b/src/material/input/_input-theme.scss @@ -1,4 +1,3 @@ -@use '../core/theming/theming'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -33,7 +32,5 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-input') { - // No-op - } + // No-op } diff --git a/src/material/list/_list-theme.scss b/src/material/list/_list-theme.scss index 400208bcdad9..d1b47f683c34 100644 --- a/src/material/list/_list-theme.scss +++ b/src/material/list/_list-theme.scss @@ -2,7 +2,6 @@ @use '../checkbox/m2-checkbox'; @use '../core/theming/inspection'; -@use '../core/theming/theming'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @use '../radio/m2-radio'; @@ -180,23 +179,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-list') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/menu/_menu-theme.scss b/src/material/menu/_menu-theme.scss index 2c575909dd1f..6fa1d6eec0f5 100644 --- a/src/material/menu/_menu-theme.scss +++ b/src/material/menu/_menu-theme.scss @@ -2,7 +2,6 @@ @use './m2-menu'; @use './m3-menu'; @use '../core/tokens/token-utils'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-menu') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/paginator/_paginator-theme.scss b/src/material/paginator/_paginator-theme.scss index 2eb63c98810e..02789a5d4199 100644 --- a/src/material/paginator/_paginator-theme.scss +++ b/src/material/paginator/_paginator-theme.scss @@ -2,7 +2,6 @@ @use './m2-paginator'; @use './m3-paginator'; @use '../core/typography/typography'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-paginator') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/progress-bar/_progress-bar-theme.scss b/src/material/progress-bar/_progress-bar-theme.scss index a50b484580f8..58c76823e99d 100644 --- a/src/material/progress-bar/_progress-bar-theme.scss +++ b/src/material/progress-bar/_progress-bar-theme.scss @@ -1,4 +1,3 @@ -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @use './m2-progress-bar'; @@ -74,23 +73,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-progress-bar') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/progress-spinner/_progress-spinner-theme.scss b/src/material/progress-spinner/_progress-spinner-theme.scss index 2869aea10d62..d5486410e0e0 100644 --- a/src/material/progress-spinner/_progress-spinner-theme.scss +++ b/src/material/progress-spinner/_progress-spinner-theme.scss @@ -1,4 +1,3 @@ -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @use './m2-progress-spinner'; @@ -76,23 +75,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-progress-spinner') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/radio/_radio-theme.scss b/src/material/radio/_radio-theme.scss index 70fe849d2207..5e4eb887f201 100644 --- a/src/material/radio/_radio-theme.scss +++ b/src/material/radio/_radio-theme.scss @@ -1,4 +1,3 @@ -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @@ -83,23 +82,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-radio') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/select/_select-theme.scss b/src/material/select/_select-theme.scss index ef9b5cd72a75..16347bd71103 100644 --- a/src/material/select/_select-theme.scss +++ b/src/material/select/_select-theme.scss @@ -1,5 +1,4 @@ @use '../core/theming/inspection'; -@use '../core/theming/theming'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @use './m2-select'; @@ -80,23 +79,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-select') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/sidenav/_sidenav-theme.scss b/src/material/sidenav/_sidenav-theme.scss index 2d54ba33e284..54589a006f02 100644 --- a/src/material/sidenav/_sidenav-theme.scss +++ b/src/material/sidenav/_sidenav-theme.scss @@ -1,6 +1,5 @@ @use 'sass:map'; @use '../core/theming/inspection'; -@use '../core/theming/theming'; @use '../core/tokens/token-utils'; @use './m2-sidenav'; @use './m3-sidenav'; @@ -56,23 +55,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-sidenav') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/slide-toggle/_slide-toggle-theme.scss b/src/material/slide-toggle/_slide-toggle-theme.scss index 8046e91e7399..42dba4270f8f 100644 --- a/src/material/slide-toggle/_slide-toggle-theme.scss +++ b/src/material/slide-toggle/_slide-toggle-theme.scss @@ -1,6 +1,5 @@ @use 'sass:map'; @use '../core/style/sass-utils'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @@ -114,23 +113,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-slide-toggle') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/slider/_slider-theme.scss b/src/material/slider/_slider-theme.scss index cf5d2bf1a174..6c36654cb78b 100644 --- a/src/material/slider/_slider-theme.scss +++ b/src/material/slider/_slider-theme.scss @@ -1,4 +1,3 @@ -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -84,23 +83,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-slider') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/snack-bar/_snack-bar-theme.scss b/src/material/snack-bar/_snack-bar-theme.scss index 9e70606ebfea..791d5f708d13 100644 --- a/src/material/snack-bar/_snack-bar-theme.scss +++ b/src/material/snack-bar/_snack-bar-theme.scss @@ -1,5 +1,4 @@ @use 'sass:map'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -58,23 +57,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-snack-bar') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/sort/_sort-theme.scss b/src/material/sort/_sort-theme.scss index b719755ff140..0e30441cd28c 100644 --- a/src/material/sort/_sort-theme.scss +++ b/src/material/sort/_sort-theme.scss @@ -2,7 +2,6 @@ @use './m2-sort'; @use './m3-sort'; @use '../core/typography/typography'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-sort') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/stepper/_stepper-theme.scss b/src/material/stepper/_stepper-theme.scss index f98a3bb66126..95c3f2c99536 100644 --- a/src/material/stepper/_stepper-theme.scss +++ b/src/material/stepper/_stepper-theme.scss @@ -1,4 +1,3 @@ -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -80,26 +79,24 @@ /// @param {Map} $theme The theme to generate color styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-stepper') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + @if inspection.theme-has($theme, density) { @include density($theme); + } + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { + @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - @if inspection.theme-has($theme, density) { - @include density($theme); - } - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/table/_table-theme.scss b/src/material/table/_table-theme.scss index 269f0d2220a9..d807bba45996 100644 --- a/src/material/table/_table-theme.scss +++ b/src/material/table/_table-theme.scss @@ -1,7 +1,6 @@ @use 'sass:map'; @use './m2-table'; @use './m3-table'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-table') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/tabs/_tabs-theme.scss b/src/material/tabs/_tabs-theme.scss index d632feb0d847..c2301d360a2c 100644 --- a/src/material/tabs/_tabs-theme.scss +++ b/src/material/tabs/_tabs-theme.scss @@ -1,6 +1,5 @@ @use './m2-tabs'; @use './m3-tabs'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -112,23 +111,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component (M3 only) @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-tabs') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); - @include color($theme, $color-variant); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme, $color-variant); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { + @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/timepicker/_timepicker-theme.scss b/src/material/timepicker/_timepicker-theme.scss index db7496bca64a..32b041b472ad 100644 --- a/src/material/timepicker/_timepicker-theme.scss +++ b/src/material/timepicker/_timepicker-theme.scss @@ -1,5 +1,4 @@ @use 'sass:map'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use './m2-timepicker'; @@ -62,23 +61,21 @@ /// @param {Map} $theme The theme to generate styles for. /// @param {String} $color-variant The color variant to use for the component @mixin theme($theme, $color-variant: null) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-timepicker') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/toolbar/_toolbar-theme.scss b/src/material/toolbar/_toolbar-theme.scss index bdc9ec1d3dac..3ce01ac0b32d 100644 --- a/src/material/toolbar/_toolbar-theme.scss +++ b/src/material/toolbar/_toolbar-theme.scss @@ -1,6 +1,5 @@ @use 'sass:map'; @use '../core/theming/inspection'; -@use '../core/theming/theming'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @use './m2-toolbar'; @@ -95,23 +94,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-toolbar') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/tooltip/_tooltip-theme.scss b/src/material/tooltip/_tooltip-theme.scss index 61406bef064a..9ebd3bf38370 100644 --- a/src/material/tooltip/_tooltip-theme.scss +++ b/src/material/tooltip/_tooltip-theme.scss @@ -1,4 +1,3 @@ -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/tokens/token-utils'; @use '../core/typography/typography'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-tooltip') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } } diff --git a/src/material/tree/_tree-theme.scss b/src/material/tree/_tree-theme.scss index 7fb2c370e67c..1985be922307 100644 --- a/src/material/tree/_tree-theme.scss +++ b/src/material/tree/_tree-theme.scss @@ -1,5 +1,4 @@ @use 'sass:map'; -@use '../core/theming/theming'; @use '../core/theming/inspection'; @use '../core/typography/typography'; @use '../core/tokens/token-utils'; @@ -57,23 +56,21 @@ } @mixin theme($theme) { - @include theming.private-check-duplicate-theme-styles($theme, 'mat-tree') { - @if inspection.get-theme-version($theme) == 1 { - @include base($theme); + @if inspection.get-theme-version($theme) == 1 { + @include base($theme); + @include color($theme); + @include density($theme); + @include typography($theme); + } @else { + @include base($theme); + @if inspection.theme-has($theme, color) { @include color($theme); + } + @if inspection.theme-has($theme, density) { @include density($theme); + } + @if inspection.theme-has($theme, typography) { @include typography($theme); - } @else { - @include base($theme); - @if inspection.theme-has($theme, color) { - @include color($theme); - } - @if inspection.theme-has($theme, density) { - @include density($theme); - } - @if inspection.theme-has($theme, typography) { - @include typography($theme); - } } } }