File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 2
2
@import ' ../core/ripple/ripple' ;
3
3
@import ' ../core/style/elevation' ;
4
4
@import ' ../core/style/vendor-prefixes' ;
5
+ @import ' ../core/style/list-common' ;
5
6
@import ' ../../cdk/a11y/a11y' ;
6
7
7
8
$mat-slide-toggle-thumb-size : 20px !default ;
@@ -17,6 +18,7 @@ $mat-slide-toggle-bar-track-width: $mat-slide-toggle-bar-width - $mat-slide-togg
17
18
.mat-slide-toggle {
18
19
display : inline-block ;
19
20
height : $mat-slide-toggle-height ;
21
+ max-width : 100% ;
20
22
21
23
line-height : $mat-slide-toggle-height ;
22
24
@@ -53,6 +55,10 @@ $mat-slide-toggle-bar-track-width: $mat-slide-toggle-bar-width - $mat-slide-togg
53
55
cursor : pointer ;
54
56
}
55
57
58
+ .mat-slide-toggle-content {
59
+ @include mat-truncate-line ();
60
+ }
61
+
56
62
/* If the label should be placed before the thumb then we just change the orders. */
57
63
.mat-slide-toggle-label-before {
58
64
.mat-slide-toggle-label { order : 1 ; }
@@ -131,6 +137,10 @@ $mat-slide-toggle-bar-track-width: $mat-slide-toggle-bar-width - $mat-slide-togg
131
137
width : $mat-slide-toggle-bar-width ;
132
138
height : $mat-slide-toggle-bar-height ;
133
139
140
+ // Prevent shrinking of the bar container. It can happen that the content is long enough to
141
+ // shrink the bar and the thumb.
142
+ flex-shrink : 0 ;
143
+
134
144
border-radius : $mat-slide-toggle-bar-border-radius ;
135
145
136
146
@include cdk-high-contrast {
You can’t perform that action at this time.
0 commit comments