1+ @import ' ../core/style/variables' ;
12@import ' ../core/style/elevation' ;
3+ @import ' ../core/style/layout-common' ;
24@import ' ../../cdk/a11y/a11y' ;
35
6+ $mat-chip-min-height : 32px ;
47$mat-chip-vertical-padding : 7px ;
58$mat-chip-horizontal-padding : 12px ;
69
710$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 ;
1013
1114$mat-chip-avatar-vertical-padding : 0 ;
1215$mat-chip-avatar-before-padding : 0 ;
16+ $mat-chip-avatar-before-margin : 4px ;
1317$mat-chip-avatar-after-margin : 8px ;
1418
1519$mat-chips-chip-margin : 4px ;
1620
1721$mat-chip-input-width : 150px ;
18- $mat-chip-input-margin : 3 px ;
22+ $mat-chip-input-margin : 4 px ;
1923
20- $mat-chip-avatar-size : 32 px ;
24+ $mat-chip-avatar-size : 24 px ;
2125$mat-chip-remove-size : 18px ;
2226
2327.mat-chip {
@@ -31,17 +35,41 @@ $mat-chip-remove-size: 18px;
3135 @include mat-elevation-transition ;
3236 display : inline-flex ;
3337 padding : $mat-chip-vertical-padding $mat-chip-horizontal-padding ;
34- border-radius : $mat-chip-horizontal-padding * 2 ;
38+ border-radius : 16 px ;
3539 align-items : center ;
3640 cursor : default ;
41+ min-height : $mat-chip-min-height ;
3742
3843 .mat-chip-remove.mat-icon {
3944 width : $mat-chip-remove-size ;
4045 height : $mat-chip-remove-size ;
4146 }
4247
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+
4363 & :focus {
4464 outline : none ;
65+
66+ & ::after {
67+ opacity : 0.16 ;
68+ }
69+ }
70+
71+ & :active {
72+ @include mat-elevation (3 );
4573 }
4674
4775 @include cdk-high-contrast {
@@ -95,11 +123,11 @@ $mat-chip-remove-size: 18px;
95123 width : $mat-chip-avatar-size ;
96124 height : $mat-chip-avatar-size ;
97125 margin-right : $mat-chip-avatar-after-margin ;
98- margin-left : 0 ;
126+ margin-left : $mat-chip-avatar-before-margin ;
99127
100128 [dir = ' rtl' ] & {
101129 margin-left : $mat-chip-avatar-after-margin ;
102- margin-right : 0 ;
130+ margin-right : $mat-chip-avatar-before-margin ;
103131 }
104132 }
105133
0 commit comments