bootstrap 4.3.1 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +17 -2
- data/CHANGELOG.md +2 -14
- data/README.md +7 -4
- data/assets/javascripts/bootstrap/alert.js +172 -136
- data/assets/javascripts/bootstrap/base-component.js +182 -0
- data/assets/javascripts/bootstrap/button.js +101 -142
- data/assets/javascripts/bootstrap/carousel.js +483 -408
- data/assets/javascripts/bootstrap/collapse.js +340 -273
- data/assets/javascripts/bootstrap/dom/data.js +68 -0
- data/assets/javascripts/bootstrap/dom/event-handler.js +321 -0
- data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
- data/assets/javascripts/bootstrap/dom/selector-engine.js +127 -0
- data/assets/javascripts/bootstrap/dropdown.js +491 -399
- data/assets/javascripts/bootstrap/modal.js +841 -449
- data/assets/javascripts/bootstrap/offcanvas.js +866 -0
- data/assets/javascripts/bootstrap/popover.js +121 -198
- data/assets/javascripts/bootstrap/scrollspy.js +256 -240
- data/assets/javascripts/bootstrap/tab.js +218 -154
- data/assets/javascripts/bootstrap/toast.js +329 -189
- data/assets/javascripts/bootstrap/tooltip.js +651 -552
- data/assets/javascripts/bootstrap-global-this-define.js +6 -0
- data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
- data/assets/javascripts/bootstrap-sprockets.js +8 -1
- data/assets/javascripts/bootstrap.js +3503 -2892
- data/assets/javascripts/bootstrap.min.js +4 -4
- data/assets/stylesheets/_bootstrap-grid.scss +56 -18
- data/assets/stylesheets/_bootstrap-reboot.scss +5 -4
- data/assets/stylesheets/_bootstrap.scss +20 -11
- data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
- data/assets/stylesheets/bootstrap/_alert.scss +15 -9
- data/assets/stylesheets/bootstrap/_badge.scss +2 -27
- data/assets/stylesheets/bootstrap/_breadcrumb.scss +5 -18
- data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
- data/assets/stylesheets/bootstrap/_buttons.scss +28 -54
- data/assets/stylesheets/bootstrap/_card.scss +52 -125
- data/assets/stylesheets/bootstrap/_carousel.scss +70 -38
- data/assets/stylesheets/bootstrap/_close.scss +30 -31
- data/assets/stylesheets/bootstrap/_containers.scss +41 -0
- data/assets/stylesheets/bootstrap/_dropdown.scss +88 -39
- data/assets/stylesheets/bootstrap/_forms.scss +9 -330
- data/assets/stylesheets/bootstrap/_functions.scss +243 -27
- data/assets/stylesheets/bootstrap/_grid.scss +14 -33
- data/assets/stylesheets/bootstrap/_helpers.scss +9 -0
- data/assets/stylesheets/bootstrap/_images.scss +3 -3
- data/assets/stylesheets/bootstrap/_list-group.scss +61 -36
- data/assets/stylesheets/bootstrap/_mixins.scss +12 -16
- data/assets/stylesheets/bootstrap/_modal.scss +64 -84
- data/assets/stylesheets/bootstrap/_nav.scss +29 -10
- data/assets/stylesheets/bootstrap/_navbar.scss +93 -52
- data/assets/stylesheets/bootstrap/_offcanvas.scss +83 -0
- data/assets/stylesheets/bootstrap/_pagination.scss +13 -22
- data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
- data/assets/stylesheets/bootstrap/_popover.scss +29 -42
- data/assets/stylesheets/bootstrap/_progress.scss +10 -5
- data/assets/stylesheets/bootstrap/_reboot.scss +350 -208
- data/assets/stylesheets/bootstrap/_root.scss +43 -8
- data/assets/stylesheets/bootstrap/_spinners.scss +21 -7
- data/assets/stylesheets/bootstrap/_tables.scss +84 -114
- data/assets/stylesheets/bootstrap/_toasts.scss +21 -14
- data/assets/stylesheets/bootstrap/_tooltip.scss +21 -21
- data/assets/stylesheets/bootstrap/_transitions.scss +8 -1
- data/assets/stylesheets/bootstrap/_type.scss +40 -61
- data/assets/stylesheets/bootstrap/_utilities.scss +630 -17
- data/assets/stylesheets/bootstrap/_variables.scss +1007 -489
- data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
- data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +63 -0
- data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
- data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
- data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
- data/assets/stylesheets/bootstrap/forms/_form-select.scss +72 -0
- data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
- data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
- data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
- data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
- data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
- data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
- data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
- data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
- data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
- data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
- data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
- data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
- data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
- data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
- data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
- data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +37 -22
- data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
- data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
- data/assets/stylesheets/bootstrap/mixins/_buttons.scss +77 -51
- data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
- data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
- data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
- data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
- data/assets/stylesheets/bootstrap/mixins/_forms.scss +67 -115
- data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
- data/assets/stylesheets/bootstrap/mixins/_grid.scss +132 -32
- data/assets/stylesheets/bootstrap/mixins/_image.scss +0 -20
- data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
- data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
- data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
- data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
- data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
- data/assets/stylesheets/bootstrap/mixins/_utilities.scss +89 -0
- data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
- data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
- data/assets/stylesheets/bootstrap/vendor/_rfs.scss +278 -128
- data/bootstrap.gemspec +4 -6
- data/lib/bootstrap/version.rb +2 -2
- data/tasks/updater/js.rb +25 -6
- data/tasks/updater/network.rb +8 -2
- data/test/dummy_rails/app/assets/config/manifest.js +3 -0
- data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
- data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
- data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
- data/test/dummy_rails/app/views/pages/root.html +89 -0
- data/test/dummy_rails/config/application.rb +0 -3
- data/test/gemfiles/rails_6_0.gemfile +7 -0
- data/test/gemfiles/rails_6_1.gemfile +7 -0
- data/test/support/dummy_rails_integration.rb +3 -1
- data/test/test_helper.rb +18 -13
- metadata +61 -79
- data/assets/javascripts/bootstrap/util.js +0 -171
- data/assets/stylesheets/bootstrap/_code.scss +0 -48
- data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -507
- data/assets/stylesheets/bootstrap/_input-group.scss +0 -193
- data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
- data/assets/stylesheets/bootstrap/_media.scss +0 -8
- data/assets/stylesheets/bootstrap/_print.scss +0 -141
- data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -21
- data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
- data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
- data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -66
- data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
- data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
- data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -33
- data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
- data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
- data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -16
- data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
- data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
- data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
- data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
- data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
- data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
- data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
- data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
- data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
- data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
- data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
- data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
- data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
- data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
- data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
- data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
- data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
- data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
- data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
|
@@ -2,30 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
// SCSS RFS mixin
|
|
4
4
|
//
|
|
5
|
-
// Automated font
|
|
5
|
+
// Automated responsive values for font sizes, paddings, margins and much more
|
|
6
6
|
//
|
|
7
|
-
//
|
|
7
|
+
// Licensed under MIT (https://github.com/twbs/rfs/blob/main/LICENSE)
|
|
8
8
|
|
|
9
9
|
// Configuration
|
|
10
10
|
|
|
11
|
-
// Base
|
|
12
|
-
$rfs-base-
|
|
13
|
-
$rfs-
|
|
11
|
+
// Base value
|
|
12
|
+
$rfs-base-value: 1.25rem !default;
|
|
13
|
+
$rfs-unit: rem !default;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
@if $rfs-unit != rem and $rfs-unit != px {
|
|
16
|
+
@error "`#{$rfs-unit}` is not a valid unit for $rfs-unit. Use `px` or `rem`.";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Breakpoint at where values start decreasing if screen width is smaller
|
|
16
20
|
$rfs-breakpoint: 1200px !default;
|
|
17
21
|
$rfs-breakpoint-unit: px !default;
|
|
18
22
|
|
|
19
|
-
|
|
23
|
+
@if $rfs-breakpoint-unit != px and $rfs-breakpoint-unit != em and $rfs-breakpoint-unit != rem {
|
|
24
|
+
@error "`#{$rfs-breakpoint-unit}` is not a valid unit for $rfs-breakpoint-unit. Use `px`, `em` or `rem`.";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Resize values based on screen height and width
|
|
20
28
|
$rfs-two-dimensional: false !default;
|
|
21
29
|
|
|
22
30
|
// Factor of decrease
|
|
23
31
|
$rfs-factor: 10 !default;
|
|
24
32
|
|
|
25
|
-
@if type-of($rfs-factor) !=
|
|
33
|
+
@if type-of($rfs-factor) != number or $rfs-factor <= 1 {
|
|
26
34
|
@error "`#{$rfs-factor}` is not a valid $rfs-factor, it must be greater than 1.";
|
|
27
35
|
}
|
|
28
36
|
|
|
37
|
+
// Mode. Possibilities: "min-media-query", "max-media-query"
|
|
38
|
+
$rfs-mode: min-media-query !default;
|
|
39
|
+
|
|
29
40
|
// Generate enable or disable classes. Possibilities: false, "enable" or "disable"
|
|
30
41
|
$rfs-class: false !default;
|
|
31
42
|
|
|
@@ -35,170 +46,309 @@ $rfs-rem-value: 16 !default;
|
|
|
35
46
|
// Safari iframe resize bug: https://github.com/twbs/rfs/issues/14
|
|
36
47
|
$rfs-safari-iframe-resize-bug-fix: false !default;
|
|
37
48
|
|
|
38
|
-
// Disable RFS by setting $enable-
|
|
39
|
-
$enable-
|
|
49
|
+
// Disable RFS by setting $enable-rfs to false
|
|
50
|
+
$enable-rfs: true !default;
|
|
40
51
|
|
|
41
|
-
// Cache $rfs-base-
|
|
42
|
-
$rfs-base-
|
|
52
|
+
// Cache $rfs-base-value unit
|
|
53
|
+
$rfs-base-value-unit: unit($rfs-base-value);
|
|
43
54
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
$
|
|
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;
|
|
47
95
|
}
|
|
48
|
-
|
|
49
|
-
|
|
96
|
+
|
|
97
|
+
// Remove px-unit from $rfs-base-value for calculations
|
|
98
|
+
@if $rfs-base-value-unit == px {
|
|
99
|
+
$rfs-base-value: divide($rfs-base-value, $rfs-base-value * 0 + 1);
|
|
100
|
+
}
|
|
101
|
+
@else if $rfs-base-value-unit == rem {
|
|
102
|
+
$rfs-base-value: divide($rfs-base-value, divide($rfs-base-value * 0 + 1, $rfs-rem-value));
|
|
50
103
|
}
|
|
51
104
|
|
|
52
105
|
// Cache $rfs-breakpoint unit to prevent multiple calls
|
|
53
106
|
$rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
|
|
54
107
|
|
|
55
108
|
// Remove unit from $rfs-breakpoint for calculations
|
|
56
|
-
@if $rfs-breakpoint-unit-cache ==
|
|
57
|
-
$rfs-breakpoint: $rfs-breakpoint
|
|
109
|
+
@if $rfs-breakpoint-unit-cache == px {
|
|
110
|
+
$rfs-breakpoint: divide($rfs-breakpoint, $rfs-breakpoint * 0 + 1);
|
|
58
111
|
}
|
|
59
|
-
@else if $rfs-breakpoint-unit-cache ==
|
|
60
|
-
$rfs-breakpoint: $rfs-breakpoint
|
|
112
|
+
@else if $rfs-breakpoint-unit-cache == rem or $rfs-breakpoint-unit-cache == "em" {
|
|
113
|
+
$rfs-breakpoint: divide($rfs-breakpoint, divide($rfs-breakpoint * 0 + 1, $rfs-rem-value));
|
|
61
114
|
}
|
|
62
115
|
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
116
|
+
// Calculate the media query value
|
|
117
|
+
$rfs-mq-value: if($rfs-breakpoint-unit == px, #{$rfs-breakpoint}px, #{divide($rfs-breakpoint, $rfs-rem-value)}#{$rfs-breakpoint-unit});
|
|
118
|
+
$rfs-mq-property-width: if($rfs-mode == max-media-query, max-width, min-width);
|
|
119
|
+
$rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height);
|
|
120
|
+
|
|
121
|
+
// Internal mixin used to determine which media query needs to be used
|
|
122
|
+
@mixin _rfs-media-query {
|
|
123
|
+
@if $rfs-two-dimensional {
|
|
124
|
+
@if $rfs-mode == max-media-query {
|
|
125
|
+
@media (#{$rfs-mq-property-width}: #{$rfs-mq-value}), (#{$rfs-mq-property-height}: #{$rfs-mq-value}) {
|
|
126
|
+
@content;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
@else {
|
|
130
|
+
@media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) and (#{$rfs-mq-property-height}: #{$rfs-mq-value}) {
|
|
131
|
+
@content;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
74
134
|
}
|
|
75
135
|
@else {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
136
|
+
@media (#{$rfs-mq-property-width}: #{$rfs-mq-value}) {
|
|
137
|
+
@content;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
79
141
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
142
|
+
// Internal mixin that adds disable classes to the selector if needed.
|
|
143
|
+
@mixin _rfs-rule {
|
|
144
|
+
@if $rfs-class == disable and $rfs-mode == max-media-query {
|
|
145
|
+
// Adding an extra class increases specificity, which prevents the media query to override the property
|
|
146
|
+
&,
|
|
147
|
+
.disable-rfs &,
|
|
148
|
+
&.disable-rfs {
|
|
149
|
+
@content;
|
|
83
150
|
}
|
|
84
|
-
|
|
85
|
-
|
|
151
|
+
}
|
|
152
|
+
@else if $rfs-class == enable and $rfs-mode == min-media-query {
|
|
153
|
+
.enable-rfs &,
|
|
154
|
+
&.enable-rfs {
|
|
155
|
+
@content;
|
|
86
156
|
}
|
|
157
|
+
}
|
|
158
|
+
@else {
|
|
159
|
+
@content;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Internal mixin that adds enable classes to the selector if needed.
|
|
164
|
+
@mixin _rfs-media-query-rule {
|
|
87
165
|
|
|
88
|
-
|
|
89
|
-
@if $rfs-
|
|
90
|
-
|
|
166
|
+
@if $rfs-class == enable {
|
|
167
|
+
@if $rfs-mode == min-media-query {
|
|
168
|
+
@content;
|
|
91
169
|
}
|
|
92
|
-
|
|
93
|
-
|
|
170
|
+
|
|
171
|
+
@include _rfs-media-query {
|
|
172
|
+
.enable-rfs &,
|
|
173
|
+
&.enable-rfs {
|
|
174
|
+
@content;
|
|
175
|
+
}
|
|
94
176
|
}
|
|
95
|
-
|
|
96
|
-
|
|
177
|
+
}
|
|
178
|
+
@else {
|
|
179
|
+
@if $rfs-class == disable and $rfs-mode == min-media-query {
|
|
180
|
+
.disable-rfs &,
|
|
181
|
+
&.disable-rfs {
|
|
182
|
+
@content;
|
|
183
|
+
}
|
|
97
184
|
}
|
|
185
|
+
@include _rfs-media-query {
|
|
186
|
+
@content;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
98
190
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
$variable-unit: null;
|
|
191
|
+
// Helper function to get the formatted non-responsive value
|
|
192
|
+
@function rfs-value($values) {
|
|
193
|
+
// Convert to list
|
|
194
|
+
$values: if(type-of($values) != list, ($values,), $values);
|
|
104
195
|
|
|
105
|
-
|
|
106
|
-
$fs-min: $rfs-base-font-size + ($fs - $rfs-base-font-size) / $rfs-factor;
|
|
196
|
+
$val: '';
|
|
107
197
|
|
|
108
|
-
|
|
109
|
-
|
|
198
|
+
// Loop over each value and calculate value
|
|
199
|
+
@each $value in $values {
|
|
200
|
+
@if $value == 0 {
|
|
201
|
+
$val: $val + ' 0';
|
|
202
|
+
}
|
|
203
|
+
@else {
|
|
204
|
+
// Cache $value unit
|
|
205
|
+
$unit: if(type-of($value) == "number", unit($value), false);
|
|
110
206
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
207
|
+
@if $unit == px {
|
|
208
|
+
// Convert to rem if needed
|
|
209
|
+
$val: $val + ' ' + if($rfs-unit == rem, #{divide($value, $value * 0 + $rfs-rem-value)}rem, $value);
|
|
210
|
+
}
|
|
211
|
+
@else if $unit == rem {
|
|
212
|
+
// Convert to px if needed
|
|
213
|
+
$val: $val + ' ' + if($rfs-unit == px, #{divide($value, $value * 0 + 1) * $rfs-rem-value}px, $value);
|
|
214
|
+
}
|
|
215
|
+
@else {
|
|
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
|
|
217
|
+
$val: $val + ' ' + $value;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
114
221
|
|
|
115
|
-
|
|
116
|
-
|
|
222
|
+
// Remove first space
|
|
223
|
+
@return unquote(str-slice($val, 2));
|
|
224
|
+
}
|
|
117
225
|
|
|
118
|
-
|
|
119
|
-
|
|
226
|
+
// Helper function to get the responsive value calculated by RFS
|
|
227
|
+
@function rfs-fluid-value($values) {
|
|
228
|
+
// Convert to list
|
|
229
|
+
$values: if(type-of($values) != list, ($values,), $values);
|
|
120
230
|
|
|
121
|
-
|
|
122
|
-
$rfs-fluid: calc(#{$min-width} + #{$variable-width}) #{$rfs-suffix};
|
|
123
|
-
}
|
|
231
|
+
$val: '';
|
|
124
232
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
233
|
+
// Loop over each value and calculate value
|
|
234
|
+
@each $value in $values {
|
|
235
|
+
@if $value == 0 {
|
|
236
|
+
$val: $val + ' 0';
|
|
129
237
|
}
|
|
238
|
+
|
|
130
239
|
@else {
|
|
131
|
-
$
|
|
240
|
+
// Cache $value unit
|
|
241
|
+
$unit: if(type-of($value) == "number", unit($value), false);
|
|
132
242
|
|
|
133
|
-
//
|
|
134
|
-
@if $
|
|
135
|
-
$
|
|
136
|
-
}
|
|
137
|
-
@else if $rfs-breakpoint-unit == px {
|
|
138
|
-
$mq-value: #{$rfs-breakpoint}px;
|
|
243
|
+
// 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
|
|
244
|
+
@if not $unit or $unit != px and $unit != rem {
|
|
245
|
+
$val: $val + ' ' + $value;
|
|
139
246
|
}
|
|
247
|
+
|
|
140
248
|
@else {
|
|
141
|
-
|
|
142
|
-
|
|
249
|
+
// Remove unit from $value for calculations
|
|
250
|
+
$value: divide($value, $value * 0 + if($unit == px, 1, divide(1, $rfs-rem-value)));
|
|
143
251
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
&,
|
|
148
|
-
.disable-responsive-font-size &,
|
|
149
|
-
&.disable-responsive-font-size {
|
|
150
|
-
font-size: $rfs-static;
|
|
252
|
+
// Only add the media query if the value is greater than the minimum value
|
|
253
|
+
@if abs($value) <= $rfs-base-value or not $enable-rfs {
|
|
254
|
+
$val: $val + ' ' + if($rfs-unit == rem, #{divide($value, $rfs-rem-value)}rem, #{$value}px);
|
|
151
255
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
256
|
+
@else {
|
|
257
|
+
// Calculate the minimum value
|
|
258
|
+
$value-min: $rfs-base-value + divide(abs($value) - $rfs-base-value, $rfs-factor);
|
|
259
|
+
|
|
260
|
+
// Calculate difference between $value and the minimum value
|
|
261
|
+
$value-diff: abs($value) - $value-min;
|
|
262
|
+
|
|
263
|
+
// Base value formatting
|
|
264
|
+
$min-width: if($rfs-unit == rem, #{divide($value-min, $rfs-rem-value)}rem, #{$value-min}px);
|
|
265
|
+
|
|
266
|
+
// Use negative value if needed
|
|
267
|
+
$min-width: if($value < 0, -$min-width, $min-width);
|
|
156
268
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
@else {
|
|
166
|
-
font-size: $rfs-fluid;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
@if $rfs-safari-iframe-resize-bug-fix {
|
|
170
|
-
// stylelint-disable-next-line length-zero-no-unit
|
|
171
|
-
min-width: 0vw;
|
|
172
|
-
}
|
|
269
|
+
// Use `vmin` if two-dimensional is enabled
|
|
270
|
+
$variable-unit: if($rfs-two-dimensional, vmin, vw);
|
|
271
|
+
|
|
272
|
+
// Calculate the variable width between 0 and $rfs-breakpoint
|
|
273
|
+
$variable-width: #{divide($value-diff * 100, $rfs-breakpoint)}#{$variable-unit};
|
|
274
|
+
|
|
275
|
+
// Return the calculated value
|
|
276
|
+
$val: $val + ' calc(' + $min-width + if($value < 0, ' - ', ' + ') + $variable-width + ')';
|
|
173
277
|
}
|
|
174
278
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// Remove first space
|
|
283
|
+
@return unquote(str-slice($val, 2));
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// RFS mixin
|
|
287
|
+
@mixin rfs($values, $property: font-size) {
|
|
288
|
+
@if $values != null {
|
|
289
|
+
$val: rfs-value($values);
|
|
290
|
+
$fluidVal: rfs-fluid-value($values);
|
|
291
|
+
|
|
292
|
+
// Do not print the media query if responsive & non-responsive values are the same
|
|
293
|
+
@if $val == $fluidVal {
|
|
294
|
+
#{$property}: $val;
|
|
295
|
+
}
|
|
296
|
+
@else {
|
|
297
|
+
@include _rfs-rule {
|
|
298
|
+
#{$property}: if($rfs-mode == max-media-query, $val, $fluidVal);
|
|
299
|
+
|
|
300
|
+
// Include safari iframe resize fix if needed
|
|
301
|
+
min-width: if($rfs-safari-iframe-resize-bug-fix, (0 * 1vw), null);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
@include _rfs-media-query-rule {
|
|
305
|
+
#{$property}: if($rfs-mode == max-media-query, $fluidVal, $val);
|
|
192
306
|
}
|
|
193
307
|
}
|
|
194
308
|
}
|
|
195
309
|
}
|
|
196
310
|
|
|
197
|
-
//
|
|
198
|
-
@mixin font-size($
|
|
199
|
-
@include rfs($
|
|
311
|
+
// Shorthand helper mixins
|
|
312
|
+
@mixin font-size($value) {
|
|
313
|
+
@include rfs($value);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
@mixin padding($value) {
|
|
317
|
+
@include rfs($value, padding);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
@mixin padding-top($value) {
|
|
321
|
+
@include rfs($value, padding-top);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
@mixin padding-right($value) {
|
|
325
|
+
@include rfs($value, padding-right);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
@mixin padding-bottom($value) {
|
|
329
|
+
@include rfs($value, padding-bottom);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
@mixin padding-left($value) {
|
|
333
|
+
@include rfs($value, padding-left);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
@mixin margin($value) {
|
|
337
|
+
@include rfs($value, margin);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
@mixin margin-top($value) {
|
|
341
|
+
@include rfs($value, margin-top);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
@mixin margin-right($value) {
|
|
345
|
+
@include rfs($value, margin-right);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@mixin margin-bottom($value) {
|
|
349
|
+
@include rfs($value, margin-bottom);
|
|
200
350
|
}
|
|
201
351
|
|
|
202
|
-
@mixin
|
|
203
|
-
@include rfs($
|
|
352
|
+
@mixin margin-left($value) {
|
|
353
|
+
@include rfs($value, margin-left);
|
|
204
354
|
}
|
data/bootstrap.gemspec
CHANGED
|
@@ -14,25 +14,23 @@ Gem::Specification.new do |s|
|
|
|
14
14
|
# SassC requires Ruby 2.3.3. Also specify here to make it obvious.
|
|
15
15
|
s.required_ruby_version = '>= 2.3.3'
|
|
16
16
|
|
|
17
|
-
s.add_runtime_dependency 'popper_js', '>=
|
|
17
|
+
s.add_runtime_dependency 'popper_js', '>= 2.9.3', '< 3'
|
|
18
18
|
|
|
19
19
|
s.add_runtime_dependency 'sassc-rails', '>= 2.0.0'
|
|
20
20
|
s.add_runtime_dependency 'autoprefixer-rails', '>= 9.1.0'
|
|
21
21
|
|
|
22
22
|
# Testing dependencies
|
|
23
|
-
s.add_development_dependency 'minitest', '~> 5.
|
|
24
|
-
s.add_development_dependency 'minitest-reporters', '~> 1.
|
|
23
|
+
s.add_development_dependency 'minitest', '~> 5.14.4'
|
|
24
|
+
s.add_development_dependency 'minitest-reporters', '~> 1.4.3'
|
|
25
25
|
s.add_development_dependency 'term-ansicolor'
|
|
26
26
|
# Integration testing
|
|
27
27
|
s.add_development_dependency 'capybara', '>= 2.6.0'
|
|
28
|
-
s.add_development_dependency '
|
|
28
|
+
s.add_development_dependency 'cuprite'
|
|
29
29
|
# Dummy Rails app dependencies
|
|
30
30
|
s.add_development_dependency 'actionpack', '>= 4.1.5'
|
|
31
31
|
s.add_development_dependency 'activesupport', '>= 4.1.5'
|
|
32
32
|
s.add_development_dependency 'json', '>= 1.8.1'
|
|
33
33
|
s.add_development_dependency 'sprockets-rails', '>= 2.3.2'
|
|
34
|
-
s.add_development_dependency 'jquery-rails', '>= 3.1.0'
|
|
35
|
-
s.add_development_dependency 'slim-rails'
|
|
36
34
|
s.add_development_dependency 'uglifier'
|
|
37
35
|
|
|
38
36
|
s.files = `git ls-files`.split("\n")
|
data/lib/bootstrap/version.rb
CHANGED
data/tasks/updater/js.rb
CHANGED
|
@@ -2,6 +2,8 @@ require 'tsort'
|
|
|
2
2
|
|
|
3
3
|
class Updater
|
|
4
4
|
module Js
|
|
5
|
+
INLINED_SRCS = %w[util/backdrop.js util/component-functions.js util/focustrap.js util/index.js util/sanitizer.js util/scrollbar.js].freeze
|
|
6
|
+
|
|
5
7
|
def update_javascript_assets
|
|
6
8
|
log_status 'Updating javascripts...'
|
|
7
9
|
save_to = @save_to[:js]
|
|
@@ -11,13 +13,26 @@ class Updater
|
|
|
11
13
|
log_processed "#{bootstrap_js_files * ' '}"
|
|
12
14
|
|
|
13
15
|
log_status 'Updating javascript manifest'
|
|
14
|
-
manifest =
|
|
16
|
+
manifest = "//= require ./bootstrap-global-this-define\n"
|
|
15
17
|
bootstrap_js_files.each do |name|
|
|
16
18
|
name = name.gsub(/\.js$/, '')
|
|
17
19
|
manifest << "//= require ./bootstrap/#{name}\n"
|
|
18
20
|
end
|
|
21
|
+
manifest << "//= require ./bootstrap-global-this-undefine\n"
|
|
19
22
|
dist_js = read_files('dist/js', %w(bootstrap.js bootstrap.min.js))
|
|
20
23
|
{
|
|
24
|
+
'assets/javascripts/bootstrap-global-this-define.js' => <<~JS,
|
|
25
|
+
// Set a `globalThis` so that bootstrap components are defined on window.bootstrap instead of window.
|
|
26
|
+
window['bootstrap'] = {
|
|
27
|
+
Popper: window.Popper,
|
|
28
|
+
_originalGlobalThis: window['globalThis']
|
|
29
|
+
};
|
|
30
|
+
window['globalThis'] = window['bootstrap'];
|
|
31
|
+
JS
|
|
32
|
+
'assets/javascripts/bootstrap-global-this-undefine.js' => <<~JS,
|
|
33
|
+
window['globalThis'] = window['bootstrap']._originalGlobalThis;
|
|
34
|
+
window['bootstrap']._originalGlobalThis = null;
|
|
35
|
+
JS
|
|
21
36
|
'assets/javascripts/bootstrap-sprockets.js' => manifest,
|
|
22
37
|
'assets/javascripts/bootstrap.js' => dist_js['bootstrap.js'],
|
|
23
38
|
'assets/javascripts/bootstrap.min.js' => dist_js['bootstrap.min.js'],
|
|
@@ -29,13 +44,13 @@ class Updater
|
|
|
29
44
|
|
|
30
45
|
def bootstrap_js_files
|
|
31
46
|
@bootstrap_js_files ||= begin
|
|
32
|
-
src_files = get_paths_by_type('js/src', /\.js$/) -
|
|
47
|
+
src_files = get_paths_by_type('js/src', /\.js$/) - INLINED_SRCS
|
|
48
|
+
puts "src_files: #{src_files.inspect}"
|
|
33
49
|
imports = Deps.new
|
|
34
50
|
# Get the imports from the ES6 files to order requires correctly.
|
|
35
51
|
read_files('js/src', src_files).each do |name, content|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
.flatten(1).map { |f| "#{f}.js" }
|
|
52
|
+
file_imports = content.scan(%r{import *(?:[a-zA-Z]*|\{[a-zA-Z ,]*\}) *from '\./([\w/-]+)}).flatten(1).map { |f| "#{f}.js" }.uniq
|
|
53
|
+
imports.add name, *(file_imports - INLINED_SRCS)
|
|
39
54
|
end
|
|
40
55
|
imports.tsort
|
|
41
56
|
end
|
|
@@ -57,7 +72,11 @@ class Updater
|
|
|
57
72
|
end
|
|
58
73
|
|
|
59
74
|
def tsort_each_child(node, &block)
|
|
60
|
-
@imports[node]
|
|
75
|
+
node_imports = @imports[node]
|
|
76
|
+
if node_imports.nil?
|
|
77
|
+
raise "No imports found for #{node.inspect}"
|
|
78
|
+
end
|
|
79
|
+
node_imports.each(&block)
|
|
61
80
|
end
|
|
62
81
|
|
|
63
82
|
def tsort_each_node(&block)
|
data/tasks/updater/network.rb
CHANGED
|
@@ -25,7 +25,13 @@ class Updater
|
|
|
25
25
|
log_http_get_files files, path_url, false
|
|
26
26
|
files.map do |name|
|
|
27
27
|
Thread.start {
|
|
28
|
-
|
|
28
|
+
begin
|
|
29
|
+
url = "#{path_url}/#{name}"
|
|
30
|
+
contents[name] = URI.open(url).read
|
|
31
|
+
rescue Exception => e
|
|
32
|
+
log "Error downloading #{url}: #{e}"
|
|
33
|
+
exit 1
|
|
34
|
+
end
|
|
29
35
|
WRITE_FILES_MUTEX.synchronize { write_cached_files path, name => contents[name] }
|
|
30
36
|
}
|
|
31
37
|
end.each(&:join)
|
|
@@ -62,7 +68,7 @@ class Updater
|
|
|
62
68
|
File.read(cache_path, mode: 'rb')
|
|
63
69
|
else
|
|
64
70
|
log_http_get_file url, false
|
|
65
|
-
content = open(url).read
|
|
71
|
+
content = URI.open(url).read
|
|
66
72
|
File.open(cache_path, 'wb') { |f| f.write content }
|
|
67
73
|
content
|
|
68
74
|
end
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
//= require jquery
|
|
2
1
|
//= require popper.js
|
|
3
2
|
//= require bootstrap-sprockets
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
5
|
+
for (const tooltipTriggerEl of document.querySelectorAll('[data-bs-toggle="tooltip"]')) {
|
|
6
|
+
new bootstrap.Tooltip(tooltipTriggerEl)
|
|
7
|
+
}
|
|
7
8
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Chrome >= 25
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
4
5
|
<title>bootstrap Dummy App</title>
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
7
|
<%= stylesheet_link_tag 'application', media: "all", 'data-turbolinks-track' => true %>
|
|
6
|
-
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
|
7
8
|
<%= csrf_meta_tags %>
|
|
8
9
|
</head>
|
|
9
10
|
|
|
10
11
|
<body>
|
|
11
12
|
<%= yield %>
|
|
13
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
|
12
14
|
</body>
|
|
13
15
|
|
|
14
16
|
</html>
|