bootstrap 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/assets/javascripts/bootstrap-sprockets.js +7 -7
- data/assets/javascripts/bootstrap.js +332 -311
- data/assets/javascripts/bootstrap.min.js +2 -2
- data/assets/javascripts/bootstrap/alert.js +18 -17
- data/assets/javascripts/bootstrap/base-component.js +34 -25
- data/assets/javascripts/bootstrap/button.js +18 -19
- data/assets/javascripts/bootstrap/carousel.js +67 -52
- data/assets/javascripts/bootstrap/collapse.js +15 -6
- data/assets/javascripts/bootstrap/dom/data.js +2 -2
- data/assets/javascripts/bootstrap/dom/event-handler.js +2 -2
- data/assets/javascripts/bootstrap/dom/manipulator.js +2 -2
- data/assets/javascripts/bootstrap/dom/selector-engine.js +2 -2
- data/assets/javascripts/bootstrap/dropdown.js +61 -44
- data/assets/javascripts/bootstrap/modal.js +171 -108
- data/assets/javascripts/bootstrap/offcanvas.js +144 -95
- data/assets/javascripts/bootstrap/popover.js +35 -20
- data/assets/javascripts/bootstrap/scrollspy.js +14 -5
- data/assets/javascripts/bootstrap/tab.js +18 -10
- data/assets/javascripts/bootstrap/toast.js +17 -15
- data/assets/javascripts/bootstrap/tooltip.js +20 -21
- data/assets/stylesheets/_bootstrap-grid.scss +1 -1
- data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
- data/assets/stylesheets/_bootstrap.scss +1 -1
- data/assets/stylesheets/bootstrap/_card.scss +5 -5
- data/assets/stylesheets/bootstrap/_carousel.scss +2 -2
- data/assets/stylesheets/bootstrap/_dropdown.scss +4 -4
- data/assets/stylesheets/bootstrap/_functions.scss +61 -3
- data/assets/stylesheets/bootstrap/_images.scss +1 -1
- data/assets/stylesheets/bootstrap/_modal.scss +4 -4
- data/assets/stylesheets/bootstrap/_offcanvas.scss +4 -2
- data/assets/stylesheets/bootstrap/_popover.scss +10 -10
- data/assets/stylesheets/bootstrap/_tables.scss +1 -1
- data/assets/stylesheets/bootstrap/_toasts.scss +1 -1
- data/assets/stylesheets/bootstrap/_tooltip.scss +4 -4
- data/assets/stylesheets/bootstrap/_variables.scss +22 -18
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
- data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +3 -1
- data/assets/stylesheets/bootstrap/forms/_form-check.scss +1 -1
- data/assets/stylesheets/bootstrap/forms/_form-range.scss +1 -1
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +3 -0
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +16 -9
- data/assets/stylesheets/bootstrap/vendor/_rfs.scss +55 -13
- data/lib/bootstrap/version.rb +2 -2
- metadata +2 -2
@@ -4,7 +4,7 @@
|
|
4
4
|
//
|
5
5
|
// Automated responsive values for font sizes, paddings, margins and much more
|
6
6
|
//
|
7
|
-
// Licensed under MIT (https://github.com/twbs/rfs/blob/
|
7
|
+
// Licensed under MIT (https://github.com/twbs/rfs/blob/main/LICENSE)
|
8
8
|
|
9
9
|
// Configuration
|
10
10
|
|
@@ -52,12 +52,54 @@ $enable-rfs: true !default;
|
|
52
52
|
// Cache $rfs-base-value unit
|
53
53
|
$rfs-base-value-unit: unit($rfs-base-value);
|
54
54
|
|
55
|
+
@function divide($dividend, $divisor, $precision: 10) {
|
56
|
+
$sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
|
57
|
+
$dividend: abs($dividend);
|
58
|
+
$divisor: abs($divisor);
|
59
|
+
@if $dividend == 0 {
|
60
|
+
@return 0;
|
61
|
+
}
|
62
|
+
@if $divisor == 0 {
|
63
|
+
@error "Cannot divide by 0";
|
64
|
+
}
|
65
|
+
$remainder: $dividend;
|
66
|
+
$result: 0;
|
67
|
+
$factor: 10;
|
68
|
+
@while ($remainder > 0 and $precision >= 0) {
|
69
|
+
$quotient: 0;
|
70
|
+
@while ($remainder >= $divisor) {
|
71
|
+
$remainder: $remainder - $divisor;
|
72
|
+
$quotient: $quotient + 1;
|
73
|
+
}
|
74
|
+
$result: $result * 10 + $quotient;
|
75
|
+
$factor: $factor * .1;
|
76
|
+
$remainder: $remainder * 10;
|
77
|
+
$precision: $precision - 1;
|
78
|
+
@if ($precision < 0 and $remainder >= $divisor * 5) {
|
79
|
+
$result: $result + 1;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
$result: $result * $factor * $sign;
|
83
|
+
$dividend-unit: unit($dividend);
|
84
|
+
$divisor-unit: unit($divisor);
|
85
|
+
$unit-map: (
|
86
|
+
"px": 1px,
|
87
|
+
"rem": 1rem,
|
88
|
+
"em": 1em,
|
89
|
+
"%": 1%
|
90
|
+
);
|
91
|
+
@if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
|
92
|
+
$result: $result * map-get($unit-map, $dividend-unit);
|
93
|
+
}
|
94
|
+
@return $result;
|
95
|
+
}
|
96
|
+
|
55
97
|
// Remove px-unit from $rfs-base-value for calculations
|
56
98
|
@if $rfs-base-value-unit == px {
|
57
|
-
$rfs-base-value: $rfs-base-value
|
99
|
+
$rfs-base-value: divide($rfs-base-value, $rfs-base-value * 0 + 1);
|
58
100
|
}
|
59
101
|
@else if $rfs-base-value-unit == rem {
|
60
|
-
$rfs-base-value: $rfs-base-value
|
102
|
+
$rfs-base-value: divide($rfs-base-value, divide($rfs-base-value * 0 + 1, $rfs-rem-value));
|
61
103
|
}
|
62
104
|
|
63
105
|
// Cache $rfs-breakpoint unit to prevent multiple calls
|
@@ -65,14 +107,14 @@ $rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
|
|
65
107
|
|
66
108
|
// Remove unit from $rfs-breakpoint for calculations
|
67
109
|
@if $rfs-breakpoint-unit-cache == px {
|
68
|
-
$rfs-breakpoint: $rfs-breakpoint
|
110
|
+
$rfs-breakpoint: divide($rfs-breakpoint, $rfs-breakpoint * 0 + 1);
|
69
111
|
}
|
70
112
|
@else if $rfs-breakpoint-unit-cache == rem or $rfs-breakpoint-unit-cache == "em" {
|
71
|
-
$rfs-breakpoint: $rfs-breakpoint
|
113
|
+
$rfs-breakpoint: divide($rfs-breakpoint, divide($rfs-breakpoint * 0 + 1, $rfs-rem-value));
|
72
114
|
}
|
73
115
|
|
74
116
|
// Calculate the media query value
|
75
|
-
$rfs-mq-value: if($rfs-breakpoint-unit == px, #{$rfs-breakpoint}px, #{$rfs-breakpoint
|
117
|
+
$rfs-mq-value: if($rfs-breakpoint-unit == px, #{$rfs-breakpoint}px, #{divide($rfs-breakpoint, $rfs-rem-value)}#{$rfs-breakpoint-unit});
|
76
118
|
$rfs-mq-property-width: if($rfs-mode == max-media-query, max-width, min-width);
|
77
119
|
$rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height);
|
78
120
|
|
@@ -164,11 +206,11 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
|
|
164
206
|
|
165
207
|
@if $unit == px {
|
166
208
|
// Convert to rem if needed
|
167
|
-
$val: $val + ' ' + if($rfs-unit == rem, #{$value
|
209
|
+
$val: $val + ' ' + if($rfs-unit == rem, #{divide($value, $value * 0 + $rfs-rem-value)}rem, $value);
|
168
210
|
}
|
169
211
|
@else if $unit == rem {
|
170
212
|
// Convert to px if needed
|
171
|
-
$val: $val + ' ' + if($rfs-unit == px, #{$value
|
213
|
+
$val: $val + ' ' + if($rfs-unit == px, #{divide($value, $value * 0 + 1) * $rfs-rem-value}px, $value);
|
172
214
|
}
|
173
215
|
@else {
|
174
216
|
// If $value isn't a number (like inherit) or $value has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
|
@@ -205,21 +247,21 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
|
|
205
247
|
|
206
248
|
@else {
|
207
249
|
// Remove unit from $value for calculations
|
208
|
-
$value: $value
|
250
|
+
$value: divide($value, $value * 0 + if($unit == px, 1, divide(1, $rfs-rem-value)));
|
209
251
|
|
210
252
|
// Only add the media query if the value is greater than the minimum value
|
211
253
|
@if abs($value) <= $rfs-base-value or not $enable-rfs {
|
212
|
-
$val: $val + ' ' + if($rfs-unit == rem, #{$value
|
254
|
+
$val: $val + ' ' + if($rfs-unit == rem, #{divide($value, $rfs-rem-value)}rem, #{$value}px);
|
213
255
|
}
|
214
256
|
@else {
|
215
257
|
// Calculate the minimum value
|
216
|
-
$value-min: $rfs-base-value + (abs($value) - $rfs-base-value
|
258
|
+
$value-min: $rfs-base-value + divide(abs($value) - $rfs-base-value, $rfs-factor);
|
217
259
|
|
218
260
|
// Calculate difference between $value and the minimum value
|
219
261
|
$value-diff: abs($value) - $value-min;
|
220
262
|
|
221
263
|
// Base value formatting
|
222
|
-
$min-width: if($rfs-unit == rem, #{$value-min
|
264
|
+
$min-width: if($rfs-unit == rem, #{divide($value-min, $rfs-rem-value)}rem, #{$value-min}px);
|
223
265
|
|
224
266
|
// Use negative value if needed
|
225
267
|
$min-width: if($value < 0, -$min-width, $min-width);
|
@@ -228,7 +270,7 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
|
|
228
270
|
$variable-unit: if($rfs-two-dimensional, vmin, vw);
|
229
271
|
|
230
272
|
// Calculate the variable width between 0 and $rfs-breakpoint
|
231
|
-
$variable-width: #{$value-diff * 100
|
273
|
+
$variable-width: #{divide($value-diff * 100, $rfs-breakpoint)}#{$variable-unit};
|
232
274
|
|
233
275
|
// Return the calculated value
|
234
276
|
$val: $val + ' calc(' + $min-width + if($value < 0, ' - ', ' + ') + $variable-width + ')';
|
data/lib/bootstrap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Twitter, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: popper_js
|