@use 'sass:map'; @use './m2-ripple'; @use './m3-ripple'; @use '../tokens/token-utils'; @use '../style/sass-utils'; @use '../theming/theming'; @use '../theming/inspection'; @mixin base($theme) { @if inspection.get-theme-version($theme) == 1 { @include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), base)); } @else { } } @mixin color($theme) { @if inspection.get-theme-version($theme) == 1 { @include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), color)); } @else { @include sass-utils.current-selector-or-root() { @include token-utils.create-token-values-mixed(m2-ripple.get-color-tokens($theme)); } } } @mixin typography($theme) { @if inspection.get-theme-version($theme) == 1 { @include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), typography)); } @else { @include sass-utils.current-selector-or-root() { @include token-utils.create-token-values-mixed(m2-ripple.get-typography-tokens($theme)); } } } @mixin density($theme) { @if inspection.get-theme-version($theme) == 1 { @include token-utils.create-token-values(map.get(m3-ripple.get-tokens($theme), density)); } @else { @include sass-utils.current-selector-or-root() { @include token-utils.create-token-values-mixed(m2-ripple.get-density-tokens($theme)); } } } /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction. @function _define-overrides() { @return ( ( namespace: ripple, tokens: token-utils.get-overrides(m3-ripple.get-tokens(), ripple) ), ); } @mixin overrides($tokens: ()) { @include token-utils.batch-create-token-values($tokens, _define-overrides()); } @mixin theme($theme) { @include theming.private-check-duplicate-theme-styles($theme, 'mat-ripple') { @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); } } } }