-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(material-experimental/theming): add M3 autocomplete, badge, and …
- Loading branch information
Showing
8 changed files
with
244 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,67 @@ | ||
@use 'sass:map'; | ||
@use '../core/theming/theming'; | ||
@use '../core/theming/inspection'; | ||
@use '../core/typography/typography'; | ||
@use '../core/style/sass-utils'; | ||
@use '../core/tokens/token-utils'; | ||
@use '../core/tokens/m2/mat/autocomplete' as tokens-mat-autocomplete; | ||
|
||
@mixin base($theme) {} | ||
@mixin base($theme) { | ||
@if inspection.get-theme-version($theme) == 1 { | ||
@include _theme-from-tokens(inspection.get-theme-tokens($theme, base)); | ||
} | ||
@else {} | ||
} | ||
|
||
@mixin color($theme) { | ||
@include sass-utils.current-selector-or-root() { | ||
@include token-utils.create-token-values(tokens-mat-autocomplete.$prefix, | ||
tokens-mat-autocomplete.get-color-tokens($theme)); | ||
@if inspection.get-theme-version($theme) == 1 { | ||
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color)); | ||
} | ||
@else { | ||
@include sass-utils.current-selector-or-root() { | ||
@include token-utils.create-token-values(tokens-mat-autocomplete.$prefix, | ||
tokens-mat-autocomplete.get-color-tokens($theme)); | ||
} | ||
} | ||
} | ||
|
||
@mixin typography($theme) {} | ||
@mixin typography($theme) { | ||
@if inspection.get-theme-version($theme) == 1 { | ||
@include _theme-from-tokens(inspection.get-theme-tokens($theme, typography)); | ||
} | ||
@else {} | ||
} | ||
|
||
@mixin density($theme) {} | ||
@mixin density($theme) { | ||
@if inspection.get-theme-version($theme) == 1 { | ||
@include _theme-from-tokens(inspection.get-theme-tokens($theme, density)); | ||
} | ||
@else {} | ||
} | ||
|
||
@mixin theme($theme) { | ||
@include theming.private-check-duplicate-theme-styles($theme, 'mat-autocomplete') { | ||
@include base($theme); | ||
@if inspection.theme-has($theme, color) { | ||
@include color($theme); | ||
} | ||
@if inspection.theme-has($theme, density) { | ||
@include density($theme); | ||
@if inspection.get-theme-version($theme) == 1 { | ||
@include _theme-from-tokens(inspection.get-theme-tokens($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); | ||
} | ||
} | ||
} | ||
} | ||
|
||
@mixin _theme-from-tokens($tokens) { | ||
@if ($tokens != ()) { | ||
@include token-utils.create-token-values( | ||
tokens-mat-autocomplete.$prefix, map.get($tokens, tokens-mat-autocomplete.$prefix)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.