Skip to content

Commit 6282aaf

Browse files
committed
Fix small custom toggle active state knob width
1 parent dd5de66 commit 6282aaf

10 files changed

+38
-25
lines changed

dist/css/shards-demo.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/shards-demo.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/shards-extras.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/shards-extras.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/shards.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/shards.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/shards.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/css/shards.min.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/scss/_custom-forms.scss

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
background-color: $custom-control-indicator-disabled-bg;
5151
}
5252
}
53-
53+
5454
}
5555
}
5656

@@ -152,7 +152,7 @@
152152
&::after {
153153
border-color: $border-color;
154154
}
155-
}
155+
}
156156
}
157157

158158
// Radios
@@ -180,7 +180,7 @@
180180
opacity: 0;
181181
transform: scale(0);
182182
}
183-
183+
184184
.custom-control-input:checked ~ .custom-control-label {
185185
&::before {
186186
@include gradient-bg($custom-control-indicator-checked-bg);
@@ -206,7 +206,7 @@
206206
&::after {
207207
background: $border-color;
208208
}
209-
}
209+
}
210210
}
211211

212212
// Select
@@ -284,7 +284,7 @@
284284
.custom-file {
285285
height: $custom-file-height;
286286
font-size: $input-font-size;
287-
287+
288288
@include transition($input-transition);
289289
}
290290

@@ -296,7 +296,7 @@
296296
border-color: $custom-file-focus-border-color;
297297
color: $input-focus-color;
298298
box-shadow: $custom-file-focus-box-shadow;
299-
299+
300300
&::after {
301301
border-color: $custom-file-focus-border-color;
302302
color: theme-color("primary");
@@ -348,7 +348,7 @@
348348
line-height: $custom-file-line-height;
349349
color: $custom-file-button-color;
350350
border-left: $custom-file-border-width solid $custom-file-border-color;
351-
351+
352352
@include gradient-bg($custom-file-button-bg);
353353
@include border-radius(0 $custom-file-border-radius $custom-file-border-radius 0);
354354
}
@@ -387,7 +387,7 @@
387387
}
388388
}
389389

390-
// Checked state
390+
// Checked state
391391
.custom-control-input:checked ~ .custom-control-label {
392392
// Background
393393
&::before {
@@ -414,7 +414,7 @@
414414
background: $border-color;
415415
}
416416
}
417-
417+
418418
// Active state
419419
.custom-control-input:active:not(:disabled) ~ .custom-control-label {
420420
// Knob
@@ -452,7 +452,7 @@
452452
}
453453
}
454454

455-
&.custom-toggle-sm{
455+
&.custom-toggle-sm {
456456
padding-left: 2.625rem;
457457

458458
.custom-control-label {
@@ -463,11 +463,11 @@
463463
display: block;
464464
width: $custom-toggle-width-sm;
465465
height: $custom-toggle-height-sm;
466-
// background: $custom-toggle-background-color;
467-
// border-radius: $custom-toggle-border-radius;
468-
// border: $custom-toggle-border;
466+
background: $custom-toggle-background-color;
467+
border-radius: $custom-toggle-border-radius;
468+
border: $custom-toggle-border;
469469
}
470-
470+
471471
// Knob
472472
&::after {
473473
content: '';
@@ -477,18 +477,22 @@
477477
width: $custom-toggle-knob-width-sm;
478478
height: $custom-toggle-knob-height-sm;
479479
}
480-
481-
482480
}
483481

484-
// Checked state
482+
// Checked state
485483
.custom-control-input:checked ~ .custom-control-label {
486484
// Knob
487485
&::after {
488486
left: $custom-toggle-width-sm - $custom-toggle-border-width - 0.1875rem;
489487
}
490488
}
491489

492-
490+
// Active state
491+
.custom-control-input:active:not(:disabled) ~ .custom-control-label {
492+
// Knob
493+
&::after {
494+
width: $custom-toggle-knob-active-width-sm;
495+
}
496+
}
493497
}
494498
}

src/scss/_variables.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,10 @@ $custom-toggle-width-sm : 2.1875rem !default;
508508
$custom-toggle-height-sm : 1.125rem !default;
509509

510510
$custom-toggle-knob-width-sm: .75rem !default;
511+
$custom-toggle-knob-active-width-sm: 1rem !default;
511512
$custom-toggle-knob-height-sm: .75rem !default;
512513

514+
513515
// Form validation
514516
$form-feedback-valid-color: theme-color("success") !default;
515517
$form-feedback-invalid-color: theme-color("danger") !default;

0 commit comments

Comments
 (0)