|
| 1 | +@use '../../token-utils'; |
| 2 | +@use '../../../typography/typography-utils'; |
| 3 | +@use '../../../style/sass-utils'; |
| 4 | + |
| 5 | +// The prefix used to generate the fully qualified name for tokens in this file. |
| 6 | +$prefix: (mat, grid-list); |
| 7 | + |
| 8 | +// Tokens that can't be configured through Angular Material's current theming API, |
| 9 | +// but may be in a future version of the theming API. |
| 10 | +@function get-unthemable-tokens() { |
| 11 | + @return (); |
| 12 | +} |
| 13 | + |
| 14 | +// Tokens that can be configured through Angular Material's color theming API. |
| 15 | +@function get-color-tokens($config) { |
| 16 | + @return (); |
| 17 | +} |
| 18 | + |
| 19 | +// Tokens that can be configured through Angular Material's typography theming API. |
| 20 | +@function get-typography-tokens($config) { |
| 21 | + @return ( |
| 22 | + // TODO(crisbeto): other components have tokens for all typography dimensions. |
| 23 | + // Here we only set the font size to maintain the same appearance as the pre-tokens |
| 24 | + // theming API. Consider adding more tokens for letter spacing, font weight etc. |
| 25 | + tile-header-primary-text-size: typography-utils.font-size($config, body-1), |
| 26 | + tile-header-secondary-text-size: typography-utils.font-size($config, caption), |
| 27 | + tile-footer-primary-text-size: typography-utils.font-size($config, body-1), |
| 28 | + tile-footer-secondary-text-size: typography-utils.font-size($config, caption), |
| 29 | + ); |
| 30 | +} |
| 31 | + |
| 32 | +// Tokens that can be configured through Angular Material's density theming API. |
| 33 | +@function get-density-tokens($config) { |
| 34 | + @return (); |
| 35 | +} |
| 36 | + |
| 37 | +// Combines the tokens generated by the above functions into a single map with placeholder values. |
| 38 | +// This is used to create token slots. |
| 39 | +@function get-token-slots() { |
| 40 | + @return sass-utils.deep-merge-all( |
| 41 | + get-unthemable-tokens(), |
| 42 | + get-color-tokens(token-utils.$placeholder-color-config), |
| 43 | + get-typography-tokens(token-utils.$placeholder-typography-config), |
| 44 | + get-density-tokens(token-utils.$placeholder-density-config) |
| 45 | + ); |
| 46 | +} |
0 commit comments