3
3
$mat-chip-vertical-padding : 8px ;
4
4
$mat-chip-horizontal-padding : 12px ;
5
5
6
- $mat-chip-vertical-padding : 8px - $mat-chip-border-width ;
7
- $mat-chip-horizontal-padding : 12px - $mat-chip-border-width ;
8
-
9
- $mat-chip-margin : ($mat-chip-horizontal-padding / 4 );
10
-
11
- $mat-chip-remove-margin : $mat-chip-line-height * 2 ;
12
- $mat-chip-remove-icon-offset : 3px ;
13
- $mat-chip-remove-size : 24px ;
14
- $mat-chip-remove-font-size : 18px ;
15
-
16
- @mixin chip-margin () {
17
- [dir = ' rtl' ] & {
18
- margin-right : $mat-chip-margin ;
19
- margin-left : $mat-chip-margin ;
20
- }
21
-
22
- [dir = ' ltr' ] & {
23
- margin-right : $mat-chip-margin ;
24
- margin-left : $mat-chip-margin ;
25
- }
26
- }
27
-
28
- @mixin chip-margin-last () {
29
- [dir = ' rtl' ] & {
30
- margin-left : 0 ;
31
- margin-right : $mat-chip-margin ;
32
- }
33
-
34
- [dir = ' ltr' ] & {
35
- margin-right : 0 ;
36
- margin-left : $mat-chip-margin ;
37
- }
38
- }
39
-
40
- @mixin chip-margin-first () {
41
- [dir = ' ltr' ] & {
42
- margin-left : 0 ;
43
- margin-right : $mat-chip-margin ;
44
- }
45
-
46
- [dir = ' rtl' ] & {
47
- margin-right : 0 ;
48
- margin-left : $mat-chip-margin ;
49
- }
50
- }
6
+ $mat-chips-chip-margin : $mat-chip-horizontal-padding / 4 ;
51
7
52
8
.mat-chip-list-wrapper {
53
-
54
9
display : flex ;
55
10
flex-direction : row ;
56
11
flex-wrap : wrap ;
57
12
align-items : flex-start ;
58
-
59
- .mat-chip {
60
- margin : $mat-chip-margin ;
61
-
62
- // Do not apply the special margins inside an input container
63
- // Remove the margin from the first element (in both LTR and RTL)
64
- & :first-child {
65
- @include chip-margin-first ();
66
- }
67
-
68
- // Remove the margin from the last element (in both LTR and RTL)
69
- & :last-child {
70
- @include chip-margin-last ();
71
- }
72
- }
73
- }
74
-
75
- .mat-input-container .mat-chip-list-wrapper .map-chip :last-child {
76
- @include chip-margin ();
77
13
}
78
14
79
- .mat-input-prefix .mat-chip-list-wrapper {
80
- flex-wrap : nowrap ;
81
- }
82
-
83
- .mat-chip {
15
+ .mat-chip :not (.mat-basic-chip ) {
84
16
display : inline-block ;
85
- position : relative ;
86
-
87
- padding : $mat-chip-vertical-padding $mat-chip-horizontal-padding ;
88
- border : $mat-chip-border-width solid transparent ;
17
+ padding : $mat-chip-vertical-padding $mat-chip-horizontal-padding $mat-chip-vertical-padding $mat-chip-horizontal-padding ;
89
18
border-radius : $mat-chip-horizontal-padding * 2 ;
90
19
91
20
// Apply a margin to adjacent sibling chips.
@@ -105,17 +34,26 @@ $mat-chip-remove-font-size: 18px;
105
34
.mat-chip-list-stacked .mat-chip-list-wrapper {
106
35
display : block ;
107
36
108
- .mat-chip {
37
+ .mat-chip :not ( .mat-basic-chip ) {
109
38
display : block ;
110
39
margin : 0 ;
111
40
margin-bottom : $mat-chip-vertical-padding ;
41
+
42
+ [dir = ' rtl' ] & {
43
+ margin : 0 ;
44
+ margin-bottom : $mat-chip-vertical-padding ;
45
+ }
46
+
47
+ & :last-child , [dir = ' rtl' ] & :last-child {
48
+ margin-bottom : 0 ;
49
+ }
112
50
}
113
51
}
114
52
115
- .mat-chip-remove .mat-chip-remove-hidden {
116
- display : none ;
53
+ .mat-input-prefix .mat-chip-list-wrapper {
54
+ margin-bottom : $mat-chip-vertical-padding ;
117
55
}
118
56
119
- .mat-chip-input {
120
- @include chip-margin-last () ;
57
+ .mat-chip-remove.mat-chip-remove-hidden {
58
+ display : none ;
121
59
}
0 commit comments