1 // Embedded icons from Open Iconic.
2 // Released under MIT and copyright 2014 Waybury.
3 // https://useiconic.com/open
6 // Checkboxes and radios
8 // Base class takes care of all the key behavioral aspects.
13 min-height: (1rem * $line-height-base);
14 padding-left: $custom-control-gutter;
17 .custom-control-inline {
19 margin-right: $custom-control-spacer-x;
22 .custom-control-input {
24 z-index: -1; // Put the input behind the label so it doesn't overlay text
27 &:checked ~ .custom-control-label::before {
28 color: $custom-control-indicator-checked-color;
29 @include gradient-bg($custom-control-indicator-checked-bg);
30 @include box-shadow($custom-control-indicator-checked-box-shadow);
33 &:focus ~ .custom-control-label::before {
34 // the mixin is not used here to make sure there is feedback
35 box-shadow: $custom-control-indicator-focus-box-shadow;
38 &:active ~ .custom-control-label::before {
39 color: $custom-control-indicator-active-color;
40 background-color: $custom-control-indicator-active-bg;
41 @include box-shadow($custom-control-indicator-active-box-shadow);
45 ~ .custom-control-label {
46 color: $custom-control-label-disabled-color;
49 background-color: $custom-control-indicator-disabled-bg;
55 // Custom control indicators
57 // Build the custom controls out of psuedo-elements.
59 .custom-control-label {
62 // Background-color and (when enabled) gradient
65 top: (($line-height-base - $custom-control-indicator-size) / 2);
68 width: $custom-control-indicator-size;
69 height: $custom-control-indicator-size;
73 background-color: $custom-control-indicator-bg;
74 @include box-shadow($custom-control-indicator-box-shadow);
80 top: (($line-height-base - $custom-control-indicator-size) / 2);
83 width: $custom-control-indicator-size;
84 height: $custom-control-indicator-size;
86 background-repeat: no-repeat;
87 background-position: center center;
88 background-size: $custom-control-indicator-bg-size;
95 // Tweak just a few things for checkboxes.
98 .custom-control-label::before {
99 @include border-radius($custom-checkbox-indicator-border-radius);
102 .custom-control-input:checked ~ .custom-control-label {
104 @include gradient-bg($custom-control-indicator-checked-bg);
107 background-image: $custom-checkbox-indicator-icon-checked;
111 .custom-control-input:indeterminate ~ .custom-control-label {
113 @include gradient-bg($custom-checkbox-indicator-indeterminate-bg);
114 @include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow);
117 background-image: $custom-checkbox-indicator-icon-indeterminate;
124 // Tweak just a few things for radios.
127 .custom-control-label::before {
128 border-radius: $custom-radio-indicator-border-radius;
131 .custom-control-input:checked ~ .custom-control-label {
133 @include gradient-bg($custom-control-indicator-checked-bg);
136 background-image: $custom-radio-indicator-icon-checked;
144 // Replaces the browser default select with a custom one, mostly pulled from
145 // http://primercss.io.
149 display: inline-block;
151 height: $input-height;
152 padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x;
153 line-height: $custom-select-line-height;
154 color: $custom-select-color;
155 vertical-align: middle;
156 background: $custom-select-bg $custom-select-indicator no-repeat right $custom-select-padding-x center;
157 background-size: $custom-select-bg-size;
158 border: $custom-select-border-width solid $custom-select-border-color;
159 @if $enable-rounded {
160 border-radius: $custom-select-border-radius;
167 border-color: $custom-select-focus-border-color;
169 box-shadow: $custom-select-focus-box-shadow;
172 // For visual consistency with other platforms/browsers,
173 // suppress the default white text on blue background highlight given to
174 // the selected option text when the (still closed) <select> receives focus
175 // in IE and (under certain conditions) Edge.
176 // See https://github.com/twbs/bootstrap/issues/19398.
178 background-color: $input-bg;
183 &[size]:not([size="1"]) {
185 padding-right: $custom-select-padding-x;
186 background-image: none;
190 color: $custom-select-disabled-color;
191 background-color: $custom-select-disabled-bg;
194 // Hides the default caret in IE11
201 height: $custom-select-height-sm;
202 padding-top: $custom-select-padding-y;
203 padding-bottom: $custom-select-padding-y;
204 font-size: $custom-select-font-size-sm;
208 height: $custom-select-height-lg;
209 padding-top: $custom-select-padding-y;
210 padding-bottom: $custom-select-padding-y;
211 font-size: $custom-select-font-size-lg;
217 // Custom file input.
221 display: inline-block;
223 height: $custom-file-height;
231 height: $custom-file-height;
235 &:focus ~ .custom-file-control {
236 border-color: $custom-file-focus-border-color;
237 box-shadow: $custom-file-focus-box-shadow;
240 border-color: $custom-file-focus-border-color;
244 @each $lang, $value in $custom-file-text {
245 &:lang(#{$lang}) ~ .custom-file-label::after {
257 height: $custom-file-height;
258 padding: $custom-file-padding-y $custom-file-padding-x;
259 line-height: $custom-file-line-height;
260 color: $custom-file-color;
261 background-color: $custom-file-bg;
262 border: $custom-file-border-width solid $custom-file-border-color;
263 @include border-radius($custom-file-border-radius);
264 @include box-shadow($custom-file-box-shadow);
273 height: calc(#{$custom-file-height} - #{$custom-file-border-width} * 2);
274 padding: $custom-file-padding-y $custom-file-padding-x;
275 line-height: $custom-file-line-height;
276 color: $custom-file-button-color;
278 @include gradient-bg($custom-file-button-bg);
279 border-left: $custom-file-border-width solid $custom-file-border-color;
280 @include border-radius(0 $custom-file-border-radius $custom-file-border-radius 0);