-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(form controls): add support for control sizing of
b-form-file
,…
- Loading branch information
1 parent
6b3329d
commit 18c3957
Showing
19 changed files
with
603 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
// Adds control sizing to bootstrap custom checkbox/switch inputs | ||
|
||
.custom-checkbox.b-custom-control-lg, | ||
.input-group-lg .custom-checkbox { | ||
font-size: $font-size-lg; | ||
line-height: $line-height-lg; | ||
padding-left: $b-custom-control-gutter-lg + $b-custom-control-indicator-size-lg; | ||
|
||
.custom-control-label::before { | ||
top: ($font-size-lg * $line-height-lg - $b-custom-control-indicator-size-lg) / 2; | ||
left: -($b-custom-control-gutter-lg + $b-custom-control-indicator-size-lg); | ||
width: $b-custom-control-indicator-size-lg; | ||
height: $b-custom-control-indicator-size-lg; | ||
@include border-radius($b-custom-checkbox-indicator-border-radius-lg); | ||
} | ||
|
||
.custom-control-label::after { | ||
top: ($font-size-lg * $line-height-lg - $b-custom-control-indicator-size-lg) / 2; | ||
left: -($b-custom-control-gutter-lg + $b-custom-control-indicator-size-lg); | ||
width: $b-custom-control-indicator-size-lg; | ||
height: $b-custom-control-indicator-size-lg; | ||
background-size: $b-custom-control-indicator-bg-size-lg; | ||
} | ||
} | ||
|
||
.custom-checkbox.b-custom-control-sm, | ||
.input-group-sm .custom-checkbox { | ||
font-size: $font-size-sm; | ||
line-height: $line-height-sm; | ||
padding-left: $b-custom-control-gutter-sm + $b-custom-control-indicator-size-sm; | ||
|
||
.custom-control-label::before { | ||
top: ($font-size-sm * $line-height-sm - $b-custom-control-indicator-size-sm) / 2; | ||
left: -($b-custom-control-gutter-sm + $b-custom-control-indicator-size-sm); | ||
width: $b-custom-control-indicator-size-sm; | ||
height: $b-custom-control-indicator-size-sm; | ||
@include border-radius($b-custom-checkbox-indicator-border-radius-sm); | ||
} | ||
|
||
.custom-control-label::after { | ||
top: ($font-size-sm * $line-height-sm - $b-custom-control-indicator-size-sm) / 2; | ||
left: -($b-custom-control-gutter-sm + $b-custom-control-indicator-size-sm); | ||
width: $b-custom-control-indicator-size-sm; | ||
height: $b-custom-control-indicator-size-sm; | ||
background-size: $b-custom-control-indicator-bg-size-sm; | ||
} | ||
} | ||
|
||
.custom-switch.b-custom-control-lg, | ||
.input-group-lg .custom-switch { | ||
padding-left: $b-custom-switch-width-lg + $b-custom-control-gutter-lg; | ||
|
||
.custom-control-label { | ||
font-size: $font-size-lg; | ||
line-height: $line-height-lg; | ||
|
||
&::before { | ||
top: ($font-size-lg * $line-height-lg - $b-custom-control-indicator-size-lg) / 2; | ||
height: $b-custom-control-indicator-size-lg; | ||
left: -($b-custom-switch-width-lg + $b-custom-control-gutter-lg); | ||
width: $b-custom-switch-width-lg; | ||
border-radius: $b-custom-switch-indicator-border-radius-lg; | ||
} | ||
|
||
&::after { | ||
top: calc( | ||
#{(($font-size-lg * $line-height-lg - $b-custom-control-indicator-size-lg) / 2)} + #{$custom-control-indicator-border-width * | ||
2} | ||
); | ||
left: calc( | ||
#{- ($b-custom-switch-width-lg + $b-custom-control-gutter-lg)} + #{$custom-control-indicator-border-width * | ||
2} | ||
); | ||
width: $b-custom-switch-indicator-size-lg; | ||
height: $b-custom-switch-indicator-size-lg; | ||
border-radius: $b-custom-switch-indicator-border-radius-lg; | ||
background-size: $b-custom-control-indicator-bg-size-lg; | ||
} | ||
} | ||
|
||
.custom-control-input:checked ~ .custom-control-label { | ||
&::after { | ||
transform: translateX($b-custom-switch-width-lg - $b-custom-control-indicator-size-lg); | ||
} | ||
} | ||
} | ||
|
||
.custom-switch.b-custom-control-sm, | ||
.input-group-sm .custom-switch { | ||
padding-left: $b-custom-switch-width-sm + $b-custom-control-gutter-sm; | ||
|
||
.custom-control-label { | ||
font-size: $font-size-sm; | ||
line-height: $line-height-sm; | ||
|
||
&::before { | ||
top: ($font-size-sm * $line-height-sm - $b-custom-control-indicator-size-sm) / 2; | ||
left: -($b-custom-switch-width-sm + $b-custom-control-gutter-sm); | ||
width: $b-custom-switch-width-sm; | ||
height: $b-custom-control-indicator-size-sm; | ||
border-radius: $b-custom-switch-indicator-border-radius-sm; | ||
} | ||
|
||
&::after { | ||
top: calc( | ||
#{(($font-size-sm * $line-height-sm - $b-custom-control-indicator-size-sm) / 2)} + #{$custom-control-indicator-border-width * | ||
2} | ||
); | ||
left: calc( | ||
#{- ($b-custom-switch-width-sm + $b-custom-control-gutter-sm)} + #{$custom-control-indicator-border-width * | ||
2} | ||
); | ||
width: $b-custom-switch-indicator-size-sm; | ||
height: $b-custom-switch-indicator-size-sm; | ||
border-radius: $b-custom-switch-indicator-border-radius-sm; | ||
background-size: $b-custom-control-indicator-bg-size-sm; | ||
} | ||
} | ||
|
||
.custom-control-input:checked ~ .custom-control-label { | ||
&::after { | ||
transform: translateX($b-custom-switch-width-sm - $b-custom-control-indicator-size-sm); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
@import "form-checkbox"; | ||
@import "form-checkbox-group"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.