/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/material/core/option/_m2-option.scss
37 строк
1 KB
Andrew Seguin
refactor: align m2 and m3 token file functions by using get-tokens (#31425)
26 июн 2025, 19:15
Не верифицирован
26 июн 2025, 19:15
3db4f23
Код
Авторство
О чём код?
@use 'sass:map'; @use '../tokens/m2-utils'; @use '../tokens/m3-utils'; @function get-tokens($theme) { $system: m2-utils.get-system($theme); @return ( base: (), color: private-get-color-palette-color-tokens($theme, primary), typography: ( option-label-text-font: map.get($system, body-large-font), option-label-text-line-height: map.get($system, body-large-line-height), option-label-text-size: map.get($system, body-large-size), option-label-text-tracking: map.get($system, body-large-tracking), option-label-text-weight: map.get($system, body-large-weight) ), density: (), ); } // Tokens that can be configured through Angular Material's color theming API. @function private-get-color-palette-color-tokens($theme, $color-variant) { $system: m2-utils.get-system($theme); $system: m3-utils.replace-colors-with-variant($system, primary, $color-variant); @return ( option-selected-state-label-text-color: map.get($system, primary), option-label-text-color: map.get($system, on-surface), option-hover-state-layer-color: m3-utils.color-with-opacity( map.get($system, on-surface), map.get($system, hover-state-layer-opacity)), option-focus-state-layer-color: m3-utils.color-with-opacity( map.get($system, on-surface), map.get($system, focus-state-layer-opacity)), option-selected-state-layer-color: m3-utils.color-with-opacity( map.get($system, on-surface), map.get($system, pressed-state-layer-opacity)), ); }