|
3 | 3 | //
|
4 | 4 |
|
5 | 5 | .form-check {
|
6 |
| - display: flex; |
7 |
| - align-items: center; |
| 6 | + display: block; |
8 | 7 | min-height: $form-check-min-height;
|
| 8 | + @include ltr-rtl("padding-left", $form-check-padding-start); |
9 | 9 | margin-bottom: $form-check-margin-bottom;
|
10 | 10 |
|
11 | 11 | .form-check-input {
|
12 |
| - @include ltr-rtl("margin-right", $form-check-padding-start); |
| 12 | + // float: left; |
| 13 | + // margin-left: $form-check-padding-start * -1; |
| 14 | + @include ltr-rtl("float", left); |
| 15 | + @include ltr-rtl("margin-left", $form-check-padding-start * -1); |
13 | 16 | }
|
14 | 17 | }
|
15 | 18 |
|
16 | 19 | .form-check-input {
|
17 | 20 | width: $form-check-input-width;
|
18 | 21 | height: $form-check-input-width;
|
| 22 | + margin-top: ($line-height-base - $form-check-input-width) / 2; // line-height minus check height |
19 | 23 | vertical-align: top;
|
20 | 24 | background-color: var(--#{$variable-prefix}form-check-input-bg, $form-check-input-bg);
|
21 | 25 | background-repeat: no-repeat;
|
|
129 | 133 | }
|
130 | 134 | }
|
131 | 135 |
|
132 |
| -@each $width, $value in $form-switch-widths { |
133 |
| - $height: $value / 3 * 2; |
| 136 | +@each $size, $map in $form-switch-widths { |
| 137 | + $width: map-get($map, "width"); |
| 138 | + $height: map-get($map, "height"); |
134 | 139 |
|
135 |
| - .form-switch-#{$width} { |
| 140 | + .form-switch-#{$size} { |
136 | 141 | min-height: $height;
|
137 |
| - @include ltr-rtl("padding-left", $value + .5em); |
| 142 | + @include ltr-rtl("padding-left", $width + .5em); |
138 | 143 |
|
139 | 144 | .form-check-input {
|
140 |
| - width: $value; |
| 145 | + width: $width; |
141 | 146 | height: $height;
|
142 |
| - @include ltr-rtl("margin-left", ($value + .5em) * -1); |
| 147 | + @include ltr-rtl("margin-left", ($width + .5em) * -1); |
| 148 | + } |
| 149 | + |
| 150 | + .form-check-label { |
| 151 | + // stylelint-disable-next-line function-disallowed-list |
| 152 | + padding-top: calc((#{$height} - #{$font-size-base}) / 2); |
143 | 153 | }
|
144 | 154 | }
|
| 155 | + |
| 156 | + // $height: $value / 3 * 2; |
| 157 | + |
| 158 | + // .form-switch-#{$width} { |
| 159 | + // min-height: $height; |
| 160 | + // @include ltr-rtl("padding-left", $value + .5em); |
| 161 | + |
| 162 | + // .form-check-input { |
| 163 | + // width: $value; |
| 164 | + // height: $height; |
| 165 | + // @include ltr-rtl("margin-left", ($value + .5em) * -1); |
| 166 | + // } |
| 167 | + |
| 168 | + // .form-check-label {} |
| 169 | + // } |
145 | 170 | }
|
146 | 171 |
|
147 | 172 | .form-check-inline {
|
148 |
| - display: inline-flex; |
| 173 | + display: inline-block; |
149 | 174 | @include ltr-rtl("margin-right", $form-check-inline-margin-end);
|
150 | 175 | }
|
151 | 176 |
|
|
0 commit comments