bootstrap 4.0.0 → 4.3.1

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.
Files changed (104) hide show
  1. checksums.yaml +5 -5
  2. data/.travis.yml +1 -1
  3. data/CHANGELOG.md +8 -0
  4. data/README.md +2 -2
  5. data/Rakefile +4 -2
  6. data/assets/javascripts/bootstrap/alert.js +45 -22
  7. data/assets/javascripts/bootstrap/button.js +39 -19
  8. data/assets/javascripts/bootstrap/carousel.js +213 -51
  9. data/assets/javascripts/bootstrap/collapse.js +105 -52
  10. data/assets/javascripts/bootstrap/dropdown.js +169 -45
  11. data/assets/javascripts/bootstrap/modal.js +139 -71
  12. data/assets/javascripts/bootstrap/popover.js +77 -20
  13. data/assets/javascripts/bootstrap/scrollspy.js +87 -29
  14. data/assets/javascripts/bootstrap/tab.js +50 -32
  15. data/assets/javascripts/bootstrap/toast.js +282 -0
  16. data/assets/javascripts/bootstrap/tooltip.js +295 -59
  17. data/assets/javascripts/bootstrap/util.js +78 -45
  18. data/assets/javascripts/bootstrap-sprockets.js +7 -6
  19. data/assets/javascripts/bootstrap.js +1537 -996
  20. data/assets/javascripts/bootstrap.min.js +3 -3
  21. data/assets/stylesheets/_bootstrap-grid.scss +4 -7
  22. data/assets/stylesheets/_bootstrap-reboot.scss +3 -3
  23. data/assets/stylesheets/_bootstrap.scss +5 -3
  24. data/assets/stylesheets/bootstrap/_alert.scss +1 -1
  25. data/assets/stylesheets/bootstrap/_badge.scss +8 -1
  26. data/assets/stylesheets/bootstrap/_breadcrumb.scss +9 -6
  27. data/assets/stylesheets/bootstrap/_button-group.scss +16 -19
  28. data/assets/stylesheets/bootstrap/_buttons.scss +10 -16
  29. data/assets/stylesheets/bootstrap/_card.scss +53 -34
  30. data/assets/stylesheets/bootstrap/_carousel.scss +66 -60
  31. data/assets/stylesheets/bootstrap/_close.scss +15 -8
  32. data/assets/stylesheets/bootstrap/_code.scss +5 -13
  33. data/assets/stylesheets/bootstrap/_custom-forms.scss +250 -40
  34. data/assets/stylesheets/bootstrap/_dropdown.scss +65 -5
  35. data/assets/stylesheets/bootstrap/_forms.scss +32 -35
  36. data/assets/stylesheets/bootstrap/_functions.scss +9 -9
  37. data/assets/stylesheets/bootstrap/_images.scss +2 -2
  38. data/assets/stylesheets/bootstrap/_input-group.scss +45 -11
  39. data/assets/stylesheets/bootstrap/_jumbotron.scss +1 -0
  40. data/assets/stylesheets/bootstrap/_list-group.scss +39 -5
  41. data/assets/stylesheets/bootstrap/_mixins.scss +6 -1
  42. data/assets/stylesheets/bootstrap/_modal.scss +80 -19
  43. data/assets/stylesheets/bootstrap/_nav.scss +2 -0
  44. data/assets/stylesheets/bootstrap/_navbar.scss +9 -26
  45. data/assets/stylesheets/bootstrap/_pagination.scss +2 -6
  46. data/assets/stylesheets/bootstrap/_popover.scss +47 -59
  47. data/assets/stylesheets/bootstrap/_print.scss +23 -6
  48. data/assets/stylesheets/bootstrap/_progress.scss +16 -6
  49. data/assets/stylesheets/bootstrap/_reboot.scss +51 -50
  50. data/assets/stylesheets/bootstrap/_spinners.scss +55 -0
  51. data/assets/stylesheets/bootstrap/_tables.scss +16 -11
  52. data/assets/stylesheets/bootstrap/_toasts.scss +44 -0
  53. data/assets/stylesheets/bootstrap/_tooltip.scss +1 -1
  54. data/assets/stylesheets/bootstrap/_transitions.scss +4 -20
  55. data/assets/stylesheets/bootstrap/_type.scss +16 -16
  56. data/assets/stylesheets/bootstrap/_utilities.scss +3 -0
  57. data/assets/stylesheets/bootstrap/_variables.scss +430 -201
  58. data/assets/stylesheets/bootstrap/mixins/_badge.scss +7 -2
  59. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +29 -1
  60. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +16 -1
  61. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +3 -3
  62. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +12 -14
  63. data/assets/stylesheets/bootstrap/mixins/_caret.scss +5 -8
  64. data/assets/stylesheets/bootstrap/mixins/_deprecate.scss +10 -0
  65. data/assets/stylesheets/bootstrap/mixins/_float.scss +3 -0
  66. data/assets/stylesheets/bootstrap/mixins/_forms.scss +68 -13
  67. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +7 -7
  68. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +3 -4
  69. data/assets/stylesheets/bootstrap/mixins/_grid.scss +9 -10
  70. data/assets/stylesheets/bootstrap/mixins/_hover.scss +3 -5
  71. data/assets/stylesheets/bootstrap/mixins/_image.scss +2 -2
  72. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +1 -1
  73. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +2 -2
  74. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +1 -1
  75. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  76. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +1 -3
  77. data/assets/stylesheets/bootstrap/mixins/_size.scss +1 -0
  78. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +10 -1
  79. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +5 -3
  80. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +3 -1
  81. data/assets/stylesheets/bootstrap/mixins/_transition.scss +7 -0
  82. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +1 -0
  83. data/assets/stylesheets/bootstrap/utilities/_borders.scss +17 -1
  84. data/assets/stylesheets/bootstrap/utilities/_display.scss +6 -18
  85. data/assets/stylesheets/bootstrap/utilities/_embed.scss +7 -20
  86. data/assets/stylesheets/bootstrap/utilities/_flex.scss +5 -0
  87. data/assets/stylesheets/bootstrap/utilities/_float.scss +5 -3
  88. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +5 -0
  89. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -4
  90. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +6 -0
  91. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +8 -0
  92. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +23 -1
  93. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +19 -0
  94. data/assets/stylesheets/bootstrap/utilities/_text.scss +26 -6
  95. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +4 -2
  96. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +204 -0
  97. data/bootstrap.gemspec +6 -3
  98. data/lib/bootstrap/engine.rb +3 -0
  99. data/lib/bootstrap/version.rb +4 -2
  100. data/lib/bootstrap.rb +10 -7
  101. data/tasks/updater/js.rb +1 -1
  102. data/test/test_helper.rb +7 -6
  103. metadata +19 -12
  104. data/assets/stylesheets/bootstrap/mixins/_navbar-align.scss +0 -10
@@ -4,4 +4,5 @@
4
4
 
5
5
  @mixin invisible($visibility) {
6
6
  visibility: $visibility !important;
7
+ @include deprecate("`invisible()`", "v4.3.0", "v5");
7
8
  }
@@ -1,4 +1,4 @@
1
- // stylelint-disable declaration-no-important
1
+ // stylelint-disable property-blacklist, declaration-no-important
2
2
 
3
3
  //
4
4
  // Border
@@ -30,30 +30,46 @@
30
30
  // Border-radius
31
31
  //
32
32
 
33
+ .rounded-sm {
34
+ border-radius: $border-radius-sm !important;
35
+ }
36
+
33
37
  .rounded {
34
38
  border-radius: $border-radius !important;
35
39
  }
40
+
36
41
  .rounded-top {
37
42
  border-top-left-radius: $border-radius !important;
38
43
  border-top-right-radius: $border-radius !important;
39
44
  }
45
+
40
46
  .rounded-right {
41
47
  border-top-right-radius: $border-radius !important;
42
48
  border-bottom-right-radius: $border-radius !important;
43
49
  }
50
+
44
51
  .rounded-bottom {
45
52
  border-bottom-right-radius: $border-radius !important;
46
53
  border-bottom-left-radius: $border-radius !important;
47
54
  }
55
+
48
56
  .rounded-left {
49
57
  border-top-left-radius: $border-radius !important;
50
58
  border-bottom-left-radius: $border-radius !important;
51
59
  }
52
60
 
61
+ .rounded-lg {
62
+ border-radius: $border-radius-lg !important;
63
+ }
64
+
53
65
  .rounded-circle {
54
66
  border-radius: 50% !important;
55
67
  }
56
68
 
69
+ .rounded-pill {
70
+ border-radius: $rounded-pill !important;
71
+ }
72
+
57
73
  .rounded-0 {
58
74
  border-radius: 0 !important;
59
75
  }
@@ -8,15 +8,9 @@
8
8
  @include media-breakpoint-up($breakpoint) {
9
9
  $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
10
10
 
11
- .d#{$infix}-none { display: none !important; }
12
- .d#{$infix}-inline { display: inline !important; }
13
- .d#{$infix}-inline-block { display: inline-block !important; }
14
- .d#{$infix}-block { display: block !important; }
15
- .d#{$infix}-table { display: table !important; }
16
- .d#{$infix}-table-row { display: table-row !important; }
17
- .d#{$infix}-table-cell { display: table-cell !important; }
18
- .d#{$infix}-flex { display: flex !important; }
19
- .d#{$infix}-inline-flex { display: inline-flex !important; }
11
+ @each $value in $displays {
12
+ .d#{$infix}-#{$value} { display: $value !important; }
13
+ }
20
14
  }
21
15
  }
22
16
 
@@ -26,13 +20,7 @@
26
20
  //
27
21
 
28
22
  @media print {
29
- .d-print-none { display: none !important; }
30
- .d-print-inline { display: inline !important; }
31
- .d-print-inline-block { display: inline-block !important; }
32
- .d-print-block { display: block !important; }
33
- .d-print-table { display: table !important; }
34
- .d-print-table-row { display: table-row !important; }
35
- .d-print-table-cell { display: table-cell !important; }
36
- .d-print-flex { display: flex !important; }
37
- .d-print-inline-flex { display: inline-flex !important; }
23
+ @each $value in $displays {
24
+ .d-print-#{$value} { display: $value !important; }
25
+ }
38
26
  }
@@ -27,26 +27,13 @@
27
27
  }
28
28
  }
29
29
 
30
- .embed-responsive-21by9 {
31
- &::before {
32
- padding-top: percentage(9 / 21);
33
- }
34
- }
35
-
36
- .embed-responsive-16by9 {
37
- &::before {
38
- padding-top: percentage(9 / 16);
39
- }
40
- }
41
-
42
- .embed-responsive-4by3 {
43
- &::before {
44
- padding-top: percentage(3 / 4);
45
- }
46
- }
30
+ @each $embed-responsive-aspect-ratio in $embed-responsive-aspect-ratios {
31
+ $embed-responsive-aspect-ratio-x: nth($embed-responsive-aspect-ratio, 1);
32
+ $embed-responsive-aspect-ratio-y: nth($embed-responsive-aspect-ratio, 2);
47
33
 
48
- .embed-responsive-1by1 {
49
- &::before {
50
- padding-top: percentage(1 / 1);
34
+ .embed-responsive-#{$embed-responsive-aspect-ratio-x}by#{$embed-responsive-aspect-ratio-y} {
35
+ &::before {
36
+ padding-top: percentage($embed-responsive-aspect-ratio-y / $embed-responsive-aspect-ratio-x);
37
+ }
51
38
  }
52
39
  }
@@ -16,6 +16,11 @@
16
16
  .flex#{$infix}-wrap { flex-wrap: wrap !important; }
17
17
  .flex#{$infix}-nowrap { flex-wrap: nowrap !important; }
18
18
  .flex#{$infix}-wrap-reverse { flex-wrap: wrap-reverse !important; }
19
+ .flex#{$infix}-fill { flex: 1 1 auto !important; }
20
+ .flex#{$infix}-grow-0 { flex-grow: 0 !important; }
21
+ .flex#{$infix}-grow-1 { flex-grow: 1 !important; }
22
+ .flex#{$infix}-shrink-0 { flex-shrink: 0 !important; }
23
+ .flex#{$infix}-shrink-1 { flex-shrink: 1 !important; }
19
24
 
20
25
  .justify-content#{$infix}-start { justify-content: flex-start !important; }
21
26
  .justify-content#{$infix}-end { justify-content: flex-end !important; }
@@ -1,9 +1,11 @@
1
+ // stylelint-disable declaration-no-important
2
+
1
3
  @each $breakpoint in map-keys($grid-breakpoints) {
2
4
  @include media-breakpoint-up($breakpoint) {
3
5
  $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
4
6
 
5
- .float#{$infix}-left { @include float-left; }
6
- .float#{$infix}-right { @include float-right; }
7
- .float#{$infix}-none { @include float-none; }
7
+ .float#{$infix}-left { float: left !important; }
8
+ .float#{$infix}-right { float: right !important; }
9
+ .float#{$infix}-none { float: none !important; }
8
10
  }
9
11
  }
@@ -0,0 +1,5 @@
1
+ // stylelint-disable declaration-no-important
2
+
3
+ @each $value in $overflows {
4
+ .overflow-#{$value} { overflow: $value !important; }
5
+ }
@@ -1,10 +1,6 @@
1
1
  // stylelint-disable declaration-no-important
2
2
 
3
3
  // Common values
4
-
5
- // Sass list not in variables since it's not intended for customization.
6
- $positions: static, relative, absolute, fixed, sticky;
7
-
8
4
  @each $position in $positions {
9
5
  .position-#{$position} { position: $position !important; }
10
6
  }
@@ -0,0 +1,6 @@
1
+ // stylelint-disable declaration-no-important
2
+
3
+ .shadow-sm { box-shadow: $box-shadow-sm !important; }
4
+ .shadow { box-shadow: $box-shadow !important; }
5
+ .shadow-lg { box-shadow: $box-shadow-lg !important; }
6
+ .shadow-none { box-shadow: none !important; }
@@ -10,3 +10,11 @@
10
10
 
11
11
  .mw-100 { max-width: 100% !important; }
12
12
  .mh-100 { max-height: 100% !important; }
13
+
14
+ // Viewport additional helpers
15
+
16
+ .min-vw-100 { min-width: 100vw !important; }
17
+ .min-vh-100 { min-height: 100vh !important; }
18
+
19
+ .vw-100 { width: 100vw !important; }
20
+ .vh-100 { height: 100vh !important; }
@@ -8,7 +8,6 @@
8
8
 
9
9
  @each $prop, $abbrev in (margin: m, padding: p) {
10
10
  @each $size, $length in $spacers {
11
-
12
11
  .#{$abbrev}#{$infix}-#{$size} { #{$prop}: $length !important; }
13
12
  .#{$abbrev}t#{$infix}-#{$size},
14
13
  .#{$abbrev}y#{$infix}-#{$size} {
@@ -29,6 +28,29 @@
29
28
  }
30
29
  }
31
30
 
31
+ // Negative margins (e.g., where `.mb-n1` is negative version of `.mb-1`)
32
+ @each $size, $length in $spacers {
33
+ @if $size != 0 {
34
+ .m#{$infix}-n#{$size} { margin: -$length !important; }
35
+ .mt#{$infix}-n#{$size},
36
+ .my#{$infix}-n#{$size} {
37
+ margin-top: -$length !important;
38
+ }
39
+ .mr#{$infix}-n#{$size},
40
+ .mx#{$infix}-n#{$size} {
41
+ margin-right: -$length !important;
42
+ }
43
+ .mb#{$infix}-n#{$size},
44
+ .my#{$infix}-n#{$size} {
45
+ margin-bottom: -$length !important;
46
+ }
47
+ .ml#{$infix}-n#{$size},
48
+ .mx#{$infix}-n#{$size} {
49
+ margin-left: -$length !important;
50
+ }
51
+ }
52
+ }
53
+
32
54
  // Some special margin utils
33
55
  .m#{$infix}-auto { margin: auto !important; }
34
56
  .mt#{$infix}-auto,
@@ -0,0 +1,19 @@
1
+ //
2
+ // Stretched link
3
+ //
4
+
5
+ .stretched-link {
6
+ &::after {
7
+ position: absolute;
8
+ top: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ left: 0;
12
+ z-index: 1;
13
+ // Just in case `pointer-events: none` is set on a parent
14
+ pointer-events: auto;
15
+ content: "";
16
+ // IE10 bugfix, see https://stackoverflow.com/questions/16947967/ie10-hover-pseudo-class-doesnt-work-without-background-color
17
+ background-color: rgba(0, 0, 0, 0);
18
+ }
19
+ }
@@ -4,9 +4,12 @@
4
4
  // Text
5
5
  //
6
6
 
7
+ .text-monospace { font-family: $font-family-monospace !important; }
8
+
7
9
  // Alignment
8
10
 
9
11
  .text-justify { text-align: justify !important; }
12
+ .text-wrap { white-space: normal !important; }
10
13
  .text-nowrap { white-space: nowrap !important; }
11
14
  .text-truncate { @include text-truncate; }
12
15
 
@@ -30,23 +33,40 @@
30
33
 
31
34
  // Weight and italics
32
35
 
33
- .font-weight-light { font-weight: $font-weight-light !important; }
34
- .font-weight-normal { font-weight: $font-weight-normal !important; }
35
- .font-weight-bold { font-weight: $font-weight-bold !important; }
36
- .font-italic { font-style: italic !important; }
36
+ .font-weight-light { font-weight: $font-weight-light !important; }
37
+ .font-weight-lighter { font-weight: $font-weight-lighter !important; }
38
+ .font-weight-normal { font-weight: $font-weight-normal !important; }
39
+ .font-weight-bold { font-weight: $font-weight-bold !important; }
40
+ .font-weight-bolder { font-weight: $font-weight-bolder !important; }
41
+ .font-italic { font-style: italic !important; }
37
42
 
38
43
  // Contextual colors
39
44
 
40
- .text-white { color: #fff !important; }
45
+ .text-white { color: $white !important; }
41
46
 
42
47
  @each $color, $value in $theme-colors {
43
48
  @include text-emphasis-variant(".text-#{$color}", $value);
44
49
  }
45
50
 
51
+ .text-body { color: $body-color !important; }
46
52
  .text-muted { color: $text-muted !important; }
47
53
 
54
+ .text-black-50 { color: rgba($black, .5) !important; }
55
+ .text-white-50 { color: rgba($white, .5) !important; }
56
+
48
57
  // Misc
49
58
 
50
59
  .text-hide {
51
- @include text-hide();
60
+ @include text-hide($ignore-warning: true);
52
61
  }
62
+
63
+ .text-decoration-none { text-decoration: none !important; }
64
+
65
+ .text-break {
66
+ word-break: break-word !important; // IE & < Edge 18
67
+ overflow-wrap: break-word !important;
68
+ }
69
+
70
+ // Reset
71
+
72
+ .text-reset { color: inherit !important; }
@@ -1,11 +1,13 @@
1
+ // stylelint-disable declaration-no-important
2
+
1
3
  //
2
4
  // Visibility utilities
3
5
  //
4
6
 
5
7
  .visible {
6
- @include invisible(visible);
8
+ visibility: visible !important;
7
9
  }
8
10
 
9
11
  .invisible {
10
- @include invisible(hidden);
12
+ visibility: hidden !important;
11
13
  }
@@ -0,0 +1,204 @@
1
+ // stylelint-disable property-blacklist, scss/dollar-variable-default
2
+
3
+ // SCSS RFS mixin
4
+ //
5
+ // Automated font-resizing
6
+ //
7
+ // See https://github.com/twbs/rfs
8
+
9
+ // Configuration
10
+
11
+ // Base font size
12
+ $rfs-base-font-size: 1.25rem !default;
13
+ $rfs-font-size-unit: rem !default;
14
+
15
+ // Breakpoint at where font-size starts decreasing if screen width is smaller
16
+ $rfs-breakpoint: 1200px !default;
17
+ $rfs-breakpoint-unit: px !default;
18
+
19
+ // Resize font-size based on screen height and width
20
+ $rfs-two-dimensional: false !default;
21
+
22
+ // Factor of decrease
23
+ $rfs-factor: 10 !default;
24
+
25
+ @if type-of($rfs-factor) != "number" or $rfs-factor <= 1 {
26
+ @error "`#{$rfs-factor}` is not a valid $rfs-factor, it must be greater than 1.";
27
+ }
28
+
29
+ // Generate enable or disable classes. Possibilities: false, "enable" or "disable"
30
+ $rfs-class: false !default;
31
+
32
+ // 1 rem = $rfs-rem-value px
33
+ $rfs-rem-value: 16 !default;
34
+
35
+ // Safari iframe resize bug: https://github.com/twbs/rfs/issues/14
36
+ $rfs-safari-iframe-resize-bug-fix: false !default;
37
+
38
+ // Disable RFS by setting $enable-responsive-font-sizes to false
39
+ $enable-responsive-font-sizes: true !default;
40
+
41
+ // Cache $rfs-base-font-size unit
42
+ $rfs-base-font-size-unit: unit($rfs-base-font-size);
43
+
44
+ // Remove px-unit from $rfs-base-font-size for calculations
45
+ @if $rfs-base-font-size-unit == "px" {
46
+ $rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1);
47
+ }
48
+ @else if $rfs-base-font-size-unit == "rem" {
49
+ $rfs-base-font-size: $rfs-base-font-size / ($rfs-base-font-size * 0 + 1 / $rfs-rem-value);
50
+ }
51
+
52
+ // Cache $rfs-breakpoint unit to prevent multiple calls
53
+ $rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
54
+
55
+ // Remove unit from $rfs-breakpoint for calculations
56
+ @if $rfs-breakpoint-unit-cache == "px" {
57
+ $rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1);
58
+ }
59
+ @else if $rfs-breakpoint-unit-cache == "rem" or $rfs-breakpoint-unit-cache == "em" {
60
+ $rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1 / $rfs-rem-value);
61
+ }
62
+
63
+ // Responsive font-size mixin
64
+ @mixin rfs($fs, $important: false) {
65
+ // Cache $fs unit
66
+ $fs-unit: if(type-of($fs) == "number", unit($fs), false);
67
+
68
+ // Add !important suffix if needed
69
+ $rfs-suffix: if($important, " !important", "");
70
+
71
+ // If $fs isn't a number (like inherit) or $fs has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
72
+ @if not $fs-unit or $fs-unit != "" and $fs-unit != "px" and $fs-unit != "rem" or $fs == 0 {
73
+ font-size: #{$fs}#{$rfs-suffix};
74
+ }
75
+ @else {
76
+ // Variables for storing static and fluid rescaling
77
+ $rfs-static: null;
78
+ $rfs-fluid: null;
79
+
80
+ // Remove px-unit from $fs for calculations
81
+ @if $fs-unit == "px" {
82
+ $fs: $fs / ($fs * 0 + 1);
83
+ }
84
+ @else if $fs-unit == "rem" {
85
+ $fs: $fs / ($fs * 0 + 1 / $rfs-rem-value);
86
+ }
87
+
88
+ // Set default font-size
89
+ @if $rfs-font-size-unit == rem {
90
+ $rfs-static: #{$fs / $rfs-rem-value}rem#{$rfs-suffix};
91
+ }
92
+ @else if $rfs-font-size-unit == px {
93
+ $rfs-static: #{$fs}px#{$rfs-suffix};
94
+ }
95
+ @else {
96
+ @error "`#{$rfs-font-size-unit}` is not a valid unit for $rfs-font-size-unit. Use `px` or `rem`.";
97
+ }
98
+
99
+ // Only add media query if font-size is bigger as the minimum font-size
100
+ // If $rfs-factor == 1, no rescaling will take place
101
+ @if $fs > $rfs-base-font-size and $enable-responsive-font-sizes {
102
+ $min-width: null;
103
+ $variable-unit: null;
104
+
105
+ // Calculate minimum font-size for given font-size
106
+ $fs-min: $rfs-base-font-size + ($fs - $rfs-base-font-size) / $rfs-factor;
107
+
108
+ // Calculate difference between given font-size and minimum font-size for given font-size
109
+ $fs-diff: $fs - $fs-min;
110
+
111
+ // Base font-size formatting
112
+ // No need to check if the unit is valid, because we did that before
113
+ $min-width: if($rfs-font-size-unit == rem, #{$fs-min / $rfs-rem-value}rem, #{$fs-min}px);
114
+
115
+ // If two-dimensional, use smallest of screen width and height
116
+ $variable-unit: if($rfs-two-dimensional, vmin, vw);
117
+
118
+ // Calculate the variable width between 0 and $rfs-breakpoint
119
+ $variable-width: #{$fs-diff * 100 / $rfs-breakpoint}#{$variable-unit};
120
+
121
+ // Set the calculated font-size.
122
+ $rfs-fluid: calc(#{$min-width} + #{$variable-width}) #{$rfs-suffix};
123
+ }
124
+
125
+ // Rendering
126
+ @if $rfs-fluid == null {
127
+ // Only render static font-size if no fluid font-size is available
128
+ font-size: $rfs-static;
129
+ }
130
+ @else {
131
+ $mq-value: null;
132
+
133
+ // RFS breakpoint formatting
134
+ @if $rfs-breakpoint-unit == em or $rfs-breakpoint-unit == rem {
135
+ $mq-value: #{$rfs-breakpoint / $rfs-rem-value}#{$rfs-breakpoint-unit};
136
+ }
137
+ @else if $rfs-breakpoint-unit == px {
138
+ $mq-value: #{$rfs-breakpoint}px;
139
+ }
140
+ @else {
141
+ @error "`#{$rfs-breakpoint-unit}` is not a valid unit for $rfs-breakpoint-unit. Use `px`, `em` or `rem`.";
142
+ }
143
+
144
+ @if $rfs-class == "disable" {
145
+ // Adding an extra class increases specificity,
146
+ // which prevents the media query to override the font size
147
+ &,
148
+ .disable-responsive-font-size &,
149
+ &.disable-responsive-font-size {
150
+ font-size: $rfs-static;
151
+ }
152
+ }
153
+ @else {
154
+ font-size: $rfs-static;
155
+ }
156
+
157
+ @if $rfs-two-dimensional {
158
+ @media (max-width: #{$mq-value}), (max-height: #{$mq-value}) {
159
+ @if $rfs-class == "enable" {
160
+ .enable-responsive-font-size &,
161
+ &.enable-responsive-font-size {
162
+ font-size: $rfs-fluid;
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
+ }
173
+ }
174
+ }
175
+ @else {
176
+ @media (max-width: #{$mq-value}) {
177
+ @if $rfs-class == "enable" {
178
+ .enable-responsive-font-size &,
179
+ &.enable-responsive-font-size {
180
+ font-size: $rfs-fluid;
181
+ }
182
+ }
183
+ @else {
184
+ font-size: $rfs-fluid;
185
+ }
186
+
187
+ @if $rfs-safari-iframe-resize-bug-fix {
188
+ // stylelint-disable-next-line length-zero-no-unit
189
+ min-width: 0vw;
190
+ }
191
+ }
192
+ }
193
+ }
194
+ }
195
+ }
196
+
197
+ // The font-size & responsive-font-size mixin uses RFS to rescale font sizes
198
+ @mixin font-size($fs, $important: false) {
199
+ @include rfs($fs, $important);
200
+ }
201
+
202
+ @mixin responsive-font-size($fs, $important: false) {
203
+ @include rfs($fs, $important);
204
+ }
data/bootstrap.gemspec CHANGED
@@ -11,10 +11,13 @@ Gem::Specification.new do |s|
11
11
  s.homepage = 'https://github.com/twbs/bootstrap-rubygem'
12
12
  s.license = 'MIT'
13
13
 
14
- s.add_runtime_dependency 'popper_js', '>= 1.12.9', '< 2'
14
+ # SassC requires Ruby 2.3.3. Also specify here to make it obvious.
15
+ s.required_ruby_version = '>= 2.3.3'
15
16
 
16
- s.add_runtime_dependency 'sass', '>= 3.5.2'
17
- s.add_runtime_dependency 'autoprefixer-rails', '>= 6.0.3'
17
+ s.add_runtime_dependency 'popper_js', '>= 1.14.3', '< 2'
18
+
19
+ s.add_runtime_dependency 'sassc-rails', '>= 2.0.0'
20
+ s.add_runtime_dependency 'autoprefixer-rails', '>= 9.1.0'
18
21
 
19
22
  # Testing dependencies
20
23
  s.add_development_dependency 'minitest', '~> 5.8.0'
@@ -1,4 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'autoprefixer-rails'
4
+ require 'sassc-rails'
2
5
 
3
6
  module Bootstrap
4
7
  module Rails
@@ -1,4 +1,6 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Bootstrap
2
- VERSION = '4.0.0'
3
- BOOTSTRAP_SHA = '8a628b943cf31ca0a002c08af661a95772480225'
4
+ VERSION = '4.3.1'
5
+ BOOTSTRAP_SHA = '8fa0d3010112dca5dd6dd501173415856001ba8b'
4
6
  end
data/lib/bootstrap.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bootstrap/version'
2
4
  require 'popper_js'
3
5
 
@@ -11,9 +13,16 @@ module Bootstrap
11
13
  register_hanami
12
14
  elsif sprockets?
13
15
  register_sprockets
16
+ elsif defined?(::Sass) && ::Sass.respond_to?(:load_paths)
17
+ # The deprecated `sass` gem:
18
+ ::Sass.load_paths << stylesheets_path
14
19
  end
15
20
 
16
- configure_sass
21
+ if defined?(::Sass::Script::Value::Number)
22
+ # Set precision to 6 as per:
23
+ # https://github.com/twbs/bootstrap/blob/da717b03e6e72d7a61c007acb9223b9626ae5ee5/package.json#L28
24
+ ::Sass::Script::Value::Number.precision = [6, ::Sass::Script::Value::Number.precision].max
25
+ end
17
26
  end
18
27
 
19
28
  # Paths
@@ -48,12 +57,6 @@ module Bootstrap
48
57
 
49
58
  private
50
59
 
51
- def configure_sass
52
- require 'sass'
53
-
54
- ::Sass.load_paths << stylesheets_path
55
- end
56
-
57
60
  def register_rails_engine
58
61
  require 'bootstrap/engine'
59
62
  end
data/tasks/updater/js.rb CHANGED
@@ -29,7 +29,7 @@ class Updater
29
29
 
30
30
  def bootstrap_js_files
31
31
  @bootstrap_js_files ||= begin
32
- src_files = get_paths_by_type('js/src', /\.js$/) - %w[index.js]
32
+ src_files = get_paths_by_type('js/src', /\.js$/) - %w[index.js tools/sanitizer.js]
33
33
  imports = Deps.new
34
34
  # Get the imports from the ES6 files to order requires correctly.
35
35
  read_files('js/src', src_files).each do |name, content|
data/test/test_helper.rb CHANGED
@@ -20,16 +20,17 @@ Capybara.register_driver :poltergeist do |app|
20
20
  app,
21
21
  # inspector: '/Applications/Chromium.app/Contents/MacOS/Chromium', # open in inspector: page.driver.debug
22
22
  window_size: [1280, 1024],
23
- timeout: 90,
24
- js_errors: true
23
+ timeout: 90,
24
+ js_errors: true
25
25
  )
26
26
  end
27
27
 
28
28
  Capybara.configure do |config|
29
- config.app_host = 'http://localhost:7000'
30
- config.default_driver = :poltergeist
31
- config.javascript_driver = :poltergeist
32
- config.server_port = 7000
29
+ config.server = :webrick
30
+ config.app_host = 'http://localhost:7000'
31
+ config.default_driver = :poltergeist
32
+ config.javascript_driver = :poltergeist
33
+ config.server_port = 7000
33
34
  config.default_max_wait_time = 10
34
35
  end
35
36