-
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 grid-list support (#28131)
(cherry picked from commit f67c871)
- Loading branch information
Showing
6 changed files
with
71 additions
and
14 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
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,35 +1,68 @@ | ||
@use 'sass:map'; | ||
@use '../core/theming/theming'; | ||
@use '../core/theming/inspection'; | ||
@use '../core/typography/typography'; | ||
@use '../core/tokens/m2/mat/grid-list' as tokens-mat-grid-list; | ||
@use '../core/style/sass-utils'; | ||
@use '../core/tokens/token-utils'; | ||
|
||
@mixin base($theme) {} | ||
@mixin base($theme) { | ||
@if inspection.get-theme-version($theme) == 1 { | ||
@include _theme-from-tokens(inspection.get-theme-tokens($theme, base)); | ||
} | ||
@else {} | ||
} | ||
|
||
// Include this empty mixin for consistency with the other components. | ||
@mixin color($theme) {} | ||
@mixin color($theme) { | ||
@if inspection.get-theme-version($theme) == 1 { | ||
@include _theme-from-tokens(inspection.get-theme-tokens($theme, color)); | ||
} | ||
@else {} | ||
} | ||
|
||
@mixin typography($theme) { | ||
@include sass-utils.current-selector-or-root() { | ||
@include token-utils.create-token-values(tokens-mat-grid-list.$prefix, | ||
tokens-mat-grid-list.get-typography-tokens($theme)); | ||
@if inspection.get-theme-version($theme) == 1 { | ||
@include _theme-from-tokens(inspection.get-theme-tokens($theme, typography)); | ||
} | ||
@else { | ||
@include sass-utils.current-selector-or-root() { | ||
@include token-utils.create-token-values(tokens-mat-grid-list.$prefix, | ||
tokens-mat-grid-list.get-typography-tokens($theme)); | ||
} | ||
} | ||
} | ||
|
||
@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-grid-list') { | ||
@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-grid-list.$prefix, map.get($tokens, tokens-mat-grid-list.$prefix)); | ||
} | ||
} |