-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Expand file tree
/
Copy path_m3-select.scss
More file actions
56 lines (51 loc) · 2.16 KB
/
_m3-select.scss
File metadata and controls
56 lines (51 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@use 'sass:map';
@use 'sass:list';
@use '../core/style/elevation';
@use '../core/tokens/m3-utils';
@use '../core/theming/theming';
@use '../core/tokens/m3';
// The prefix used to generate the fully qualified name for tokens in this file.
$prefix: (mat, select);
/// Generates custom tokens for the mat-select.
/// @param {String} $color-variant The color variant to use for the component
@function get-tokens($theme: m3.$sys-theme, $color-variant: null) {
$system: m3-utils.get-system($theme);
@if $color-variant {
$system: m3-utils.replace-colors-with-variant($system, primary, $color-variant);
}
@return (
base: (
select-container-elevation-shadow: elevation.get-box-shadow(2),
select-divider-bottom-spacing: 8px,
select-divider-top-spacing: 8px
),
color: (
select-panel-background-color: map.get($system, surface-container),
select-enabled-trigger-text-color: map.get($system, on-surface),
select-disabled-trigger-text-color:
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
select-placeholder-text-color: map.get($system, on-surface-variant),
select-enabled-arrow-color: map.get($system, on-surface-variant),
select-disabled-arrow-color:
m3-utils.color-with-opacity(map.get($system, on-surface), 38%),
select-focused-arrow-color: map.get($system, primary),
select-invalid-arrow-color: map.get($system, error),
),
typography: (
select-trigger-text-font: map.get($system, body-large-font),
select-trigger-text-line-height: map.get($system, body-large-line-height),
select-trigger-text-size: map.get($system, body-large-size),
select-trigger-text-tracking: map.get($system, body-large-tracking),
select-trigger-text-weight: map.get($system, body-large-weight),
),
density: get-density-tokens(map.get($system, density-scale)),
);
}
// Tokens that can be configured through Angular Material's density theming API.
@function get-density-tokens($scale) {
$scale: theming.clamp-density($scale, -2);
$index: ($scale * -1) + 1;
@return (
select-arrow-transform: list.nth((translateY(-8px), translateY(-8px), none), $index),
);
}