12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- @use 'sass:map';
- @use '../core/theming/theming';
- @use '../core/theming/inspection';
- @use '../core/theming/validation';
- @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) {
- @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) {
- @if inspection.get-theme-version($theme) == 1 {
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, color));
- } @else {
- }
- }
- @mixin typography($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) {
- @if inspection.get-theme-version($theme) == 1 {
- @include _theme-from-tokens(inspection.get-theme-tokens($theme, density));
- } @else {
- }
- }
- /// Defines the tokens that will be available in the `overrides` mixin and for docs extraction.
- @function _define-overrides() {
- @return (
- (
- namespace: tokens-mat-grid-list.$prefix,
- tokens: tokens-mat-grid-list.get-token-slots(),
- ),
- );
- }
- @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-grid-list') {
- @if inspection.get-theme-version($theme) == 1 {
- @include _theme-from-tokens(inspection.get-theme-tokens($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) {
- @include validation.selector-defined(
- 'Calls to Angular Material theme mixins with an M3 theme must be wrapped in a selector'
- );
- @if ($tokens != ()) {
- @include token-utils.create-token-values(
- tokens-mat-grid-list.$prefix,
- map.get($tokens, tokens-mat-grid-list.$prefix)
- );
- }
- }
|