1
+ @import ' ../core/style/variables' ;
1
2
@import ' ../core/style/elevation' ;
3
+ @import ' ../core/style/layout-common' ;
2
4
@import ' ../../cdk/a11y/a11y' ;
3
5
6
+ $mat-chip-min-height : 32px ;
4
7
$mat-chip-vertical-padding : 7px ;
5
8
$mat-chip-horizontal-padding : 12px ;
6
9
7
10
$mat-chip-remove-vertical-padding : 7px ;
8
- $mat-chip-remove-before-margin : 7 px ;
9
- $mat-chip-remove-after-padding : 7 px ;
11
+ $mat-chip-remove-before-margin : 8 px ;
12
+ $mat-chip-remove-after-padding : 8 px ;
10
13
11
14
$mat-chip-avatar-vertical-padding : 0 ;
12
15
$mat-chip-avatar-before-padding : 0 ;
16
+ $mat-chip-avatar-before-margin : 4px ;
13
17
$mat-chip-avatar-after-margin : 8px ;
14
18
15
19
$mat-chips-chip-margin : 4px ;
16
20
17
21
$mat-chip-input-width : 150px ;
18
- $mat-chip-input-margin : 3 px ;
22
+ $mat-chip-input-margin : 4 px ;
19
23
20
- $mat-chip-avatar-size : 32 px ;
24
+ $mat-chip-avatar-size : 24 px ;
21
25
$mat-chip-remove-size : 18px ;
22
26
23
27
.mat-chip {
@@ -31,17 +35,41 @@ $mat-chip-remove-size: 18px;
31
35
@include mat-elevation-transition ;
32
36
display : inline-flex ;
33
37
padding : $mat-chip-vertical-padding $mat-chip-horizontal-padding ;
34
- border-radius : $mat-chip-horizontal-padding * 2 ;
38
+ border-radius : 16 px ;
35
39
align-items : center ;
36
40
cursor : default ;
41
+ min-height : $mat-chip-min-height ;
37
42
38
43
.mat-chip-remove.mat-icon {
39
44
width : $mat-chip-remove-size ;
40
45
height : $mat-chip-remove-size ;
41
46
}
42
47
48
+ // Overlay used to darken the chip on hover and focus.
49
+ & ::after {
50
+ @include mat-fill ;
51
+ border-radius : inherit ;
52
+ background-color : black ;
53
+ opacity : 0 ;
54
+ content : ' ' ;
55
+ pointer-events : none ;
56
+ transition : opacity 200ms $swift-ease-in-out-timing-function ;
57
+ }
58
+
59
+ & :hover ::after {
60
+ opacity : 0.12 ;
61
+ }
62
+
43
63
& :focus {
44
64
outline : none ;
65
+
66
+ & ::after {
67
+ opacity : 0.16 ;
68
+ }
69
+ }
70
+
71
+ & :active {
72
+ @include mat-elevation (3 );
45
73
}
46
74
47
75
@include cdk-high-contrast {
@@ -95,11 +123,11 @@ $mat-chip-remove-size: 18px;
95
123
width : $mat-chip-avatar-size ;
96
124
height : $mat-chip-avatar-size ;
97
125
margin-right : $mat-chip-avatar-after-margin ;
98
- margin-left : 0 ;
126
+ margin-left : $mat-chip-avatar-before-margin ;
99
127
100
128
[dir = ' rtl' ] & {
101
129
margin-left : $mat-chip-avatar-after-margin ;
102
- margin-right : 0 ;
130
+ margin-right : $mat-chip-avatar-before-margin ;
103
131
}
104
132
}
105
133
0 commit comments