Skip to content

Commit 98cd934

Browse files
committed
1 parent 5018328 commit 98cd934

37 files changed

+369
-237
lines changed

_sass/bootstrap/_breadcrumb.scss

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
}
1111

1212
.breadcrumb-item {
13-
display: flex;
14-
1513
// The separator between breadcrumbs (by default, a forward-slash: "/")
1614
+ .breadcrumb-item {
1715
padding-left: $breadcrumb-item-padding;
1816

1917
&::before {
20-
display: inline-block; // Suppress underlining of the separator in modern browsers
18+
float: left; // Suppress inline spacings and underlining of the separator
2119
padding-right: $breadcrumb-item-padding;
2220
color: $breadcrumb-divider-color;
2321
content: escape-svg($breadcrumb-divider);

_sass/bootstrap/_card.scss

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
}
5959

6060
.card-subtitle {
61-
margin-top: -$card-spacer-y / 2;
61+
margin-top: -$card-spacer-y * .5;
6262
margin-bottom: 0;
6363
}
6464

@@ -109,15 +109,15 @@
109109
//
110110

111111
.card-header-tabs {
112-
margin-right: -$card-spacer-x / 2;
112+
margin-right: -$card-spacer-x * .5;
113113
margin-bottom: -$card-spacer-y;
114-
margin-left: -$card-spacer-x / 2;
114+
margin-left: -$card-spacer-x * .5;
115115
border-bottom: 0;
116116
}
117117

118118
.card-header-pills {
119-
margin-right: -$card-spacer-x / 2;
120-
margin-left: -$card-spacer-x / 2;
119+
margin-right: -$card-spacer-x * .5;
120+
margin-left: -$card-spacer-x * .5;
121121
}
122122

123123
// Card image

_sass/bootstrap/_carousel.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@
9595
align-items: center; // 2. vertically center contents
9696
justify-content: center; // 3. horizontally center contents
9797
width: $carousel-control-width;
98+
padding: 0;
9899
color: $carousel-control-color;
99100
text-align: center;
101+
background: none;
102+
border: 0;
100103
opacity: $carousel-control-opacity;
101104
@include transition($carousel-control-transition);
102105

@@ -127,7 +130,7 @@
127130
display: inline-block;
128131
width: $carousel-control-icon-width;
129132
height: $carousel-control-icon-width;
130-
background: no-repeat 50% / 100% 100%;
133+
background: 50% / 100% 100% no-repeat;
131134
}
132135
.carousel-control-prev-icon {
133136
background-image: escape-svg($carousel-control-prev-icon-bg);
@@ -186,9 +189,9 @@
186189

187190
.carousel-caption {
188191
position: absolute;
189-
right: (100% - $carousel-caption-width) / 2;
192+
right: (100% - $carousel-caption-width) * .5;
190193
bottom: 20px;
191-
left: (100% - $carousel-caption-width) / 2;
194+
left: (100% - $carousel-caption-width) * .5;
192195
z-index: 10;
193196
padding-top: 20px;
194197
padding-bottom: 20px;

_sass/bootstrap/_custom-forms.scss

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
display: block;
1414
min-height: $font-size-base * $line-height-base;
1515
padding-left: $custom-control-gutter + $custom-control-indicator-size;
16-
color-adjust: exact; // Keep themed appearance for print
16+
print-color-adjust: exact; // Keep themed appearance for print
1717
}
1818

1919
.custom-control-inline {
@@ -26,7 +26,7 @@
2626
left: 0;
2727
z-index: -1; // Put the input behind the label so it doesn't overlay text
2828
width: $custom-control-indicator-size;
29-
height: ($font-size-base * $line-height-base + $custom-control-indicator-size) / 2;
29+
height: ($font-size-base * $line-height-base + $custom-control-indicator-size) * .5;
3030
opacity: 0;
3131

3232
&:checked ~ .custom-control-label::before {
@@ -83,28 +83,28 @@
8383
// Background-color and (when enabled) gradient
8484
&::before {
8585
position: absolute;
86-
top: ($font-size-base * $line-height-base - $custom-control-indicator-size) / 2;
86+
top: ($font-size-base * $line-height-base - $custom-control-indicator-size) * .5;
8787
left: -($custom-control-gutter + $custom-control-indicator-size);
8888
display: block;
8989
width: $custom-control-indicator-size;
9090
height: $custom-control-indicator-size;
9191
pointer-events: none;
9292
content: "";
9393
background-color: $custom-control-indicator-bg;
94-
border: $custom-control-indicator-border-color solid $custom-control-indicator-border-width;
94+
border: $custom-control-indicator-border-width solid $custom-control-indicator-border-color;
9595
@include box-shadow($custom-control-indicator-box-shadow);
9696
}
9797

9898
// Foreground (icon)
9999
&::after {
100100
position: absolute;
101-
top: ($font-size-base * $line-height-base - $custom-control-indicator-size) / 2;
101+
top: ($font-size-base * $line-height-base - $custom-control-indicator-size) * .5;
102102
left: -($custom-control-gutter + $custom-control-indicator-size);
103103
display: block;
104104
width: $custom-control-indicator-size;
105105
height: $custom-control-indicator-size;
106106
content: "";
107-
background: no-repeat 50% / #{$custom-control-indicator-bg-size};
107+
background: 50% / #{$custom-control-indicator-bg-size} no-repeat;
108108
}
109109
}
110110

@@ -186,7 +186,7 @@
186186
}
187187

188188
&::after {
189-
top: add(($font-size-base * $line-height-base - $custom-control-indicator-size) / 2, $custom-control-indicator-border-width * 2);
189+
top: add(($font-size-base * $line-height-base - $custom-control-indicator-size) * .5, $custom-control-indicator-border-width * 2);
190190
left: add(-($custom-switch-width + $custom-control-gutter), $custom-control-indicator-border-width * 2);
191191
width: $custom-switch-indicator-size;
192192
height: $custom-switch-indicator-size;
@@ -315,6 +315,7 @@
315315
width: 100%;
316316
height: $custom-file-height;
317317
margin: 0;
318+
overflow: hidden;
318319
opacity: 0;
319320

320321
&:focus ~ .custom-file-label {
@@ -347,6 +348,7 @@
347348
z-index: 1;
348349
height: $custom-file-height;
349350
padding: $custom-file-padding-y $custom-file-padding-x;
351+
overflow: hidden;
350352
font-family: $custom-file-font-family;
351353
font-weight: $custom-file-font-weight;
352354
line-height: $custom-file-line-height;
@@ -388,7 +390,7 @@
388390
appearance: none;
389391

390392
&:focus {
391-
outline: none;
393+
outline: 0;
392394

393395
// Pseudo-elements must be split across multiple rulesets to have an effect.
394396
// No box-shadow() mixin for focus accessibility.
@@ -404,7 +406,7 @@
404406
&::-webkit-slider-thumb {
405407
width: $custom-range-thumb-width;
406408
height: $custom-range-thumb-height;
407-
margin-top: ($custom-range-track-height - $custom-range-thumb-height) / 2; // Webkit specific
409+
margin-top: ($custom-range-track-height - $custom-range-thumb-height) * .5; // Webkit specific
408410
@include gradient-bg($custom-range-thumb-bg);
409411
border: $custom-range-thumb-border;
410412
@include border-radius($custom-range-thumb-border-radius);
@@ -479,7 +481,7 @@
479481
cursor: $custom-range-track-cursor;
480482
background-color: transparent;
481483
border-color: transparent;
482-
border-width: $custom-range-thumb-height / 2;
484+
border-width: $custom-range-thumb-height * .5;
483485
@include box-shadow($custom-range-track-box-shadow);
484486
}
485487

_sass/bootstrap/_dropdown.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
}
101101
}
102102

103-
// When enabled Popper.js, reset basic dropdown position
103+
// When Popper is enabled, reset the basic dropdown position
104104
// stylelint-disable-next-line no-duplicate-selectors
105105
.dropdown-menu {
106106
&[x-placement^="top"],

_sass/bootstrap/_forms.scss

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@
3030
border: 0;
3131
}
3232

33-
// Remove select outline from select box in FF
34-
&:-moz-focusring {
35-
color: transparent;
36-
text-shadow: 0 0 0 $input-color;
37-
}
38-
3933
// Customize the `:focus` state to imitate native WebKit styles.
4034
@include form-control-focus($ignore-warning: true);
4135

@@ -69,6 +63,12 @@ input[type="month"] {
6963
}
7064

7165
select.form-control {
66+
// Remove select outline from select box in FF
67+
&:-moz-focusring {
68+
color: transparent;
69+
text-shadow: 0 0 0 $input-color;
70+
}
71+
7272
&:focus::-ms-value {
7373
// Suppress the nested default white text on blue background highlight given to
7474
// the selected option text when the (still closed) <select> receives focus
@@ -199,13 +199,13 @@ textarea.form-control {
199199
.form-row {
200200
display: flex;
201201
flex-wrap: wrap;
202-
margin-right: -$form-grid-gutter-width / 2;
203-
margin-left: -$form-grid-gutter-width / 2;
202+
margin-right: -$form-grid-gutter-width * .5;
203+
margin-left: -$form-grid-gutter-width * .5;
204204

205205
> .col,
206206
> [class*="col-"] {
207-
padding-right: $form-grid-gutter-width / 2;
208-
padding-left: $form-grid-gutter-width / 2;
207+
padding-right: $form-grid-gutter-width * .5;
208+
padding-left: $form-grid-gutter-width * .5;
209209
}
210210
}
211211

_sass/bootstrap/_functions.scss

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
$g: green($color);
7676
$b: blue($color);
7777

78-
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;
78+
$yiq: (($r * 299) + ($g * 587) + ($b * 114)) * .001;
7979

8080
@if ($yiq >= $yiq-contrasted-threshold) {
8181
@return $dark;
@@ -140,5 +140,51 @@
140140
@return $value1 - $value2;
141141
}
142142

143+
@if type-of($value2) != number {
144+
$value2: unquote("(") + $value2 + unquote(")");
145+
}
146+
143147
@return if($return-calc == true, calc(#{$value1} - #{$value2}), $value1 + unquote(" - ") + $value2);
144148
}
149+
150+
@function divide($dividend, $divisor, $precision: 10) {
151+
$sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
152+
$dividend: abs($dividend);
153+
$divisor: abs($divisor);
154+
@if $dividend == 0 {
155+
@return 0;
156+
}
157+
@if $divisor == 0 {
158+
@error "Cannot divide by 0";
159+
}
160+
$remainder: $dividend;
161+
$result: 0;
162+
$factor: 10;
163+
@while ($remainder > 0 and $precision >= 0) {
164+
$quotient: 0;
165+
@while ($remainder >= $divisor) {
166+
$remainder: $remainder - $divisor;
167+
$quotient: $quotient + 1;
168+
}
169+
$result: $result * 10 + $quotient;
170+
$factor: $factor * .1;
171+
$remainder: $remainder * 10;
172+
$precision: $precision - 1;
173+
@if ($precision < 0 and $remainder >= $divisor * 5) {
174+
$result: $result + 1;
175+
}
176+
}
177+
$result: $result * $factor * $sign;
178+
$dividend-unit: unit($dividend);
179+
$divisor-unit: unit($divisor);
180+
$unit-map: (
181+
"px": 1px,
182+
"rem": 1rem,
183+
"em": 1em,
184+
"%": 1%
185+
);
186+
@if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
187+
$result: $result * map-get($unit-map, $dividend-unit);
188+
}
189+
@return $result;
190+
}

_sass/bootstrap/_images.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
}
3333

3434
.figure-img {
35-
margin-bottom: $spacer / 2;
35+
margin-bottom: $spacer * .5;
3636
line-height: 1;
3737
}
3838

_sass/bootstrap/_input-group.scss

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
> .form-control,
4444
> .custom-select {
45-
&:not(:last-child) { @include border-right-radius(0); }
4645
&:not(:first-child) { @include border-left-radius(0); }
4746
}
4847

@@ -56,6 +55,24 @@
5655
&:not(:last-child) .custom-file-label::after { @include border-right-radius(0); }
5756
&:not(:first-child) .custom-file-label { @include border-left-radius(0); }
5857
}
58+
59+
&:not(.has-validation) {
60+
> .form-control:not(:last-child),
61+
> .custom-select:not(:last-child),
62+
> .custom-file:not(:last-child) .custom-file-label,
63+
> .custom-file:not(:last-child) .custom-file-label::after {
64+
@include border-right-radius(0);
65+
}
66+
}
67+
68+
&.has-validation {
69+
> .form-control:nth-last-child(n + 3),
70+
> .custom-select:nth-last-child(n + 3),
71+
> .custom-file:nth-last-child(n + 3) .custom-file-label,
72+
> .custom-file:nth-last-child(n + 3) .custom-file-label::after {
73+
@include border-right-radius(0);
74+
}
75+
}
5976
}
6077

6178

@@ -175,8 +192,10 @@
175192

176193
.input-group > .input-group-prepend > .btn,
177194
.input-group > .input-group-prepend > .input-group-text,
178-
.input-group > .input-group-append:not(:last-child) > .btn,
179-
.input-group > .input-group-append:not(:last-child) > .input-group-text,
195+
.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .btn,
196+
.input-group:not(.has-validation) > .input-group-append:not(:last-child) > .input-group-text,
197+
.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .btn,
198+
.input-group.has-validation > .input-group-append:nth-last-child(n + 3) > .input-group-text,
180199
.input-group > .input-group-append:last-child > .btn:not(:last-child):not(.dropdown-toggle),
181200
.input-group > .input-group-append:last-child > .input-group-text:not(:last-child) {
182201
@include border-right-radius(0);

_sass/bootstrap/_jumbotron.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.jumbotron {
2-
padding: $jumbotron-padding ($jumbotron-padding / 2);
2+
padding: $jumbotron-padding ($jumbotron-padding * .5);
33
margin-bottom: $jumbotron-padding;
44
color: $jumbotron-color;
55
background-color: $jumbotron-bg;

_sass/bootstrap/_modal.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,15 @@
175175
flex-wrap: wrap;
176176
align-items: center; // vertically center
177177
justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
178-
padding: $modal-inner-padding - $modal-footer-margin-between / 2;
178+
padding: $modal-inner-padding - $modal-footer-margin-between * .5;
179179
border-top: $modal-footer-border-width solid $modal-footer-border-color;
180180
@include border-bottom-radius($modal-content-inner-border-radius);
181181

182182
// Place margin between footer elements
183183
// This solution is far from ideal because of the universal selector usage,
184184
// but is needed to fix https://github.com/twbs/bootstrap/issues/24800
185185
> * {
186-
margin: $modal-footer-margin-between / 2;
186+
margin: $modal-footer-margin-between * .5;
187187
}
188188
}
189189

0 commit comments

Comments
 (0)