bootstrap 4.6.0 → 5.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/README.md +7 -4
  4. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  5. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  6. data/assets/javascripts/bootstrap-sprockets.js +14 -8
  7. data/assets/javascripts/bootstrap.js +2152 -1633
  8. data/assets/javascripts/bootstrap.min.js +2 -2
  9. data/assets/javascripts/bootstrap/alert.js +179 -64
  10. data/assets/javascripts/bootstrap/base-component.js +75 -0
  11. data/assets/javascripts/bootstrap/button.js +94 -143
  12. data/assets/javascripts/bootstrap/carousel.js +386 -202
  13. data/assets/javascripts/bootstrap/collapse.js +349 -132
  14. data/assets/javascripts/bootstrap/dom/data.js +81 -0
  15. data/assets/javascripts/bootstrap/dom/event-handler.js +310 -0
  16. data/assets/javascripts/bootstrap/dom/manipulator.js +86 -0
  17. data/assets/javascripts/bootstrap/dom/selector-engine.js +93 -0
  18. data/assets/javascripts/bootstrap/dropdown.js +387 -224
  19. data/assets/javascripts/bootstrap/modal.js +391 -220
  20. data/assets/javascripts/bootstrap/popover.js +94 -49
  21. data/assets/javascripts/bootstrap/scrollspy.js +212 -80
  22. data/assets/javascripts/bootstrap/tab.js +198 -79
  23. data/assets/javascripts/bootstrap/toast.js +211 -78
  24. data/assets/javascripts/bootstrap/tooltip.js +558 -300
  25. data/assets/stylesheets/_bootstrap-grid.scss +51 -16
  26. data/assets/stylesheets/_bootstrap-reboot.scss +4 -1
  27. data/assets/stylesheets/_bootstrap.scss +15 -8
  28. data/assets/stylesheets/bootstrap/_accordion.scss +126 -0
  29. data/assets/stylesheets/bootstrap/_alert.scss +15 -10
  30. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  31. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -17
  32. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  33. data/assets/stylesheets/bootstrap/_buttons.scss +27 -60
  34. data/assets/stylesheets/bootstrap/_card.scss +21 -92
  35. data/assets/stylesheets/bootstrap/_carousel.scss +65 -33
  36. data/assets/stylesheets/bootstrap/_close.scss +30 -30
  37. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  38. data/assets/stylesheets/bootstrap/_dropdown.scss +95 -38
  39. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  40. data/assets/stylesheets/bootstrap/_functions.scss +84 -23
  41. data/assets/stylesheets/bootstrap/_grid.scss +3 -54
  42. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  43. data/assets/stylesheets/bootstrap/_list-group.scss +17 -8
  44. data/assets/stylesheets/bootstrap/_mixins.scss +7 -13
  45. data/assets/stylesheets/bootstrap/_modal.scss +41 -46
  46. data/assets/stylesheets/bootstrap/_nav.scss +16 -4
  47. data/assets/stylesheets/bootstrap/_navbar.scss +43 -71
  48. data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
  49. data/assets/stylesheets/bootstrap/_popover.scss +15 -27
  50. data/assets/stylesheets/bootstrap/_progress.scss +2 -4
  51. data/assets/stylesheets/bootstrap/_reboot.scss +314 -163
  52. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  53. data/assets/stylesheets/bootstrap/_spinners.scss +5 -5
  54. data/assets/stylesheets/bootstrap/_tables.scss +79 -114
  55. data/assets/stylesheets/bootstrap/_toasts.scss +20 -15
  56. data/assets/stylesheets/bootstrap/_tooltip.scss +17 -17
  57. data/assets/stylesheets/bootstrap/_transitions.scss +0 -1
  58. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  59. data/assets/stylesheets/bootstrap/_utilities.scss +566 -18
  60. data/assets/stylesheets/bootstrap/_variables.scss +673 -463
  61. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  62. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  63. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  64. data/assets/stylesheets/bootstrap/forms/_form-control.scss +223 -0
  65. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  67. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  68. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  69. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  70. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  71. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  72. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  73. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  74. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  75. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  76. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  77. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  78. data/assets/stylesheets/bootstrap/mixins/_alert.scss +1 -5
  79. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +8 -8
  80. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  81. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  82. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +65 -47
  83. data/assets/stylesheets/bootstrap/mixins/_caret.scss +8 -8
  84. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  85. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  86. data/assets/stylesheets/bootstrap/mixins/_forms.scss +27 -88
  87. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  88. data/assets/stylesheets/bootstrap/mixins/_grid.scss +83 -32
  89. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  90. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
  91. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  92. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +15 -8
  93. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  94. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  95. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  96. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  97. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  98. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  99. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +234 -126
  100. data/bootstrap.gemspec +1 -3
  101. data/lib/bootstrap/version.rb +2 -2
  102. data/tasks/updater/js.rb +20 -5
  103. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  104. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  105. data/test/dummy_rails/app/views/pages/root.html +89 -0
  106. data/test/dummy_rails/config/application.rb +0 -3
  107. data/test/gemfiles/rails_6_1.gemfile +7 -0
  108. metadata +44 -75
  109. data/assets/javascripts/bootstrap/util.js +0 -192
  110. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  111. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  112. data/assets/stylesheets/bootstrap/_input-group.scss +0 -208
  113. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  114. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  115. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  116. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  117. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  118. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  119. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  120. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  121. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  122. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  123. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  124. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  125. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  126. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  127. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  128. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  129. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  130. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  131. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  132. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  133. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  134. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  135. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  136. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  137. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  138. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  139. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  140. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  141. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  142. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  143. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  144. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  145. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
@@ -1,45 +1,47 @@
1
1
  // Gradients
2
2
 
3
- @mixin gradient-bg($color) {
3
+ // scss-docs-start gradient-bg-mixin
4
+ @mixin gradient-bg($color: null) {
5
+ background-color: $color;
6
+
4
7
  @if $enable-gradients {
5
- background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x;
6
- } @else {
7
- background-color: $color;
8
+ background-image: var(--#{$variable-prefix}gradient);
8
9
  }
9
10
  }
11
+ // scss-docs-end gradient-bg-mixin
10
12
 
13
+ // scss-docs-start gradient-mixins
11
14
  // Horizontal gradient, from left to right
12
15
  //
13
16
  // Creates two color stops, start and end, by specifying a color and position for each color stop.
14
17
  @mixin gradient-x($start-color: $gray-700, $end-color: $gray-800, $start-percent: 0%, $end-percent: 100%) {
15
18
  background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent);
16
- background-repeat: repeat-x;
17
19
  }
18
20
 
19
21
  // Vertical gradient, from top to bottom
20
22
  //
21
23
  // Creates two color stops, start and end, by specifying a color and position for each color stop.
22
- @mixin gradient-y($start-color: $gray-700, $end-color: $gray-800, $start-percent: 0%, $end-percent: 100%) {
24
+ @mixin gradient-y($start-color: $gray-700, $end-color: $gray-800, $start-percent: null, $end-percent: null) {
23
25
  background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent);
24
- background-repeat: repeat-x;
25
26
  }
26
27
 
27
28
  @mixin gradient-directional($start-color: $gray-700, $end-color: $gray-800, $deg: 45deg) {
28
29
  background-image: linear-gradient($deg, $start-color, $end-color);
29
- background-repeat: repeat-x;
30
30
  }
31
+
31
32
  @mixin gradient-x-three-colors($start-color: $blue, $mid-color: $purple, $color-stop: 50%, $end-color: $red) {
32
33
  background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
33
- background-repeat: no-repeat;
34
34
  }
35
+
35
36
  @mixin gradient-y-three-colors($start-color: $blue, $mid-color: $purple, $color-stop: 50%, $end-color: $red) {
36
37
  background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
37
- background-repeat: no-repeat;
38
38
  }
39
+
39
40
  @mixin gradient-radial($inner-color: $gray-700, $outer-color: $gray-800) {
40
41
  background-image: radial-gradient(circle, $inner-color, $outer-color);
41
- background-repeat: no-repeat;
42
42
  }
43
+
43
44
  @mixin gradient-striped($color: rgba($white, .15), $angle: 45deg) {
44
45
  background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
45
46
  }
47
+ // scss-docs-end gradient-mixins
@@ -2,53 +2,38 @@
2
2
  //
3
3
  // Generate semantic grid columns with these mixins.
4
4
 
5
- @mixin make-container($gutter: $grid-gutter-width) {
6
- width: 100%;
7
- padding-right: $gutter / 2;
8
- padding-left: $gutter / 2;
9
- margin-right: auto;
10
- margin-left: auto;
11
- }
12
-
13
5
  @mixin make-row($gutter: $grid-gutter-width) {
6
+ --#{$variable-prefix}gutter-x: #{$gutter};
7
+ --#{$variable-prefix}gutter-y: 0;
14
8
  display: flex;
15
9
  flex-wrap: wrap;
16
- margin-right: -$gutter / 2;
17
- margin-left: -$gutter / 2;
18
- }
19
-
20
- // For each breakpoint, define the maximum width of the container in a media query
21
- @mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {
22
- @each $breakpoint, $container-max-width in $max-widths {
23
- @include media-breakpoint-up($breakpoint, $breakpoints) {
24
- max-width: $container-max-width;
25
- }
26
- }
27
- @include deprecate("The `make-container-max-widths` mixin", "v4.5.2", "v5");
10
+ margin-top: calc(var(--#{$variable-prefix}gutter-y) * -1); // stylelint-disable-line function-disallowed-list
11
+ margin-right: calc(var(--#{$variable-prefix}gutter-x) / -2); // stylelint-disable-line function-disallowed-list
12
+ margin-left: calc(var(--#{$variable-prefix}gutter-x) / -2); // stylelint-disable-line function-disallowed-list
28
13
  }
29
14
 
30
15
  @mixin make-col-ready($gutter: $grid-gutter-width) {
31
- position: relative;
16
+ // Add box sizing if only the grid is loaded
17
+ box-sizing: if(variable-exists(include-column-box-sizing) and $include-column-box-sizing, border-box, null);
32
18
  // Prevent columns from becoming too narrow when at smaller grid tiers by
33
- // always setting `width: 100%;`. This works because we use `flex` values
19
+ // always setting `width: 100%;`. This works because we set the width
34
20
  // later on to override this initial width.
21
+ flex-shrink: 0;
35
22
  width: 100%;
36
- padding-right: $gutter / 2;
37
- padding-left: $gutter / 2;
23
+ max-width: 100%; // Prevent `.col-auto`, `.col` (& responsive variants) from breaking out the grid
24
+ padding-right: calc(var(--#{$variable-prefix}gutter-x) / 2); // stylelint-disable-line function-disallowed-list
25
+ padding-left: calc(var(--#{$variable-prefix}gutter-x) / 2); // stylelint-disable-line function-disallowed-list
26
+ margin-top: var(--#{$variable-prefix}gutter-y);
38
27
  }
39
28
 
40
29
  @mixin make-col($size, $columns: $grid-columns) {
41
- flex: 0 0 percentage($size / $columns);
42
- // Add a `max-width` to ensure content within each column does not blow out
43
- // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari
44
- // do not appear to require this.
45
- max-width: percentage($size / $columns);
30
+ flex: 0 0 auto;
31
+ width: percentage($size / $columns);
46
32
  }
47
33
 
48
34
  @mixin make-col-auto() {
49
35
  flex: 0 0 auto;
50
36
  width: auto;
51
- max-width: 100%; // Reset earlier grid tiers
52
37
  }
53
38
 
54
39
  @mixin make-col-offset($size, $columns: $grid-columns) {
@@ -63,7 +48,73 @@
63
48
  // style grid.
64
49
  @mixin row-cols($count) {
65
50
  > * {
66
- flex: 0 0 100% / $count;
67
- max-width: 100% / $count;
51
+ flex: 0 0 auto;
52
+ width: 100% / $count;
53
+ }
54
+ }
55
+
56
+ // Framework grid generation
57
+ //
58
+ // Used only by Bootstrap to generate the correct number of grid classes given
59
+ // any value of `$grid-columns`.
60
+
61
+ @mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {
62
+ @each $breakpoint in map-keys($breakpoints) {
63
+ $infix: breakpoint-infix($breakpoint, $breakpoints);
64
+
65
+ @include media-breakpoint-up($breakpoint, $breakpoints) {
66
+ // Provide basic `.col-{bp}` classes for equal-width flexbox columns
67
+ .col#{$infix} {
68
+ flex: 1 0 0%; // Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4
69
+ }
70
+
71
+ .row-cols#{$infix}-auto > * {
72
+ @include make-col-auto();
73
+ }
74
+
75
+ @if $grid-row-columns > 0 {
76
+ @for $i from 1 through $grid-row-columns {
77
+ .row-cols#{$infix}-#{$i} {
78
+ @include row-cols($i);
79
+ }
80
+ }
81
+ }
82
+
83
+ .col#{$infix}-auto {
84
+ @include make-col-auto();
85
+ }
86
+
87
+ @if $columns > 0 {
88
+ @for $i from 1 through $columns {
89
+ .col#{$infix}-#{$i} {
90
+ @include make-col($i, $columns);
91
+ }
92
+ }
93
+
94
+ // `$columns - 1` because offsetting by the width of an entire row isn't possible
95
+ @for $i from 0 through ($columns - 1) {
96
+ @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
97
+ .offset#{$infix}-#{$i} {
98
+ @include make-col-offset($i, $columns);
99
+ }
100
+ }
101
+ }
102
+ }
103
+
104
+ // Gutters
105
+ //
106
+ // Make use of `.g-*`, `.gx-*` or `.gy-*` utilities to change spacing between the columns.
107
+ @each $key, $value in $gutters {
108
+ .g#{$infix}-#{$key},
109
+ .gx#{$infix}-#{$key} {
110
+ --#{$variable-prefix}gutter-x: #{$value};
111
+ }
112
+
113
+ .g#{$infix}-#{$key},
114
+ .gy#{$infix}-#{$key} {
115
+ --#{$variable-prefix}gutter-y: #{$value};
116
+ }
117
+ }
118
+ }
68
119
  }
69
120
  }
@@ -7,30 +7,10 @@
7
7
  //
8
8
  // Keep images from scaling beyond the width of their parents.
9
9
 
10
- @mixin img-fluid() {
10
+ @mixin img-fluid {
11
11
  // Part 1: Set a maximum relative to the parent
12
12
  max-width: 100%;
13
13
  // Part 2: Override the height to auto, otherwise images will be stretched
14
14
  // when setting a width and height attribute on the img element.
15
15
  height: auto;
16
16
  }
17
-
18
-
19
- // Retina image
20
- //
21
- // Short retina mixin for setting background-image and -size.
22
-
23
- @mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
24
- background-image: url($file-1x);
25
-
26
- // Autoprefixer takes care of adding -webkit-min-device-pixel-ratio and -o-min-device-pixel-ratio,
27
- // but doesn't convert dppx=>dpi.
28
- // There's no such thing as unprefixed min-device-pixel-ratio since it's nonstandard.
29
- // Compatibility info: https://caniuse.com/css-media-resolution
30
- @media only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx
31
- only screen and (min-resolution: 2dppx) { // Standardized
32
- background-image: url($file-2x);
33
- background-size: $width-1x $height-1x;
34
- }
35
- @include deprecate("`img-retina()`", "v4.3.0", "v5");
36
- }
@@ -6,9 +6,10 @@
6
6
  background-color: $background;
7
7
 
8
8
  &.list-group-item-action {
9
- @include hover-focus() {
9
+ &:hover,
10
+ &:focus {
10
11
  color: $color;
11
- background-color: darken($background, 5%);
12
+ background-color: shade-color($background, 10%);
12
13
  }
13
14
 
14
15
  &.active {
@@ -1,7 +1,7 @@
1
1
  // Lists
2
2
 
3
3
  // Unstyled keeps list items block level, just removes default browser padding and list-style
4
- @mixin list-unstyled() {
4
+ @mixin list-unstyled {
5
5
  padding-left: 0;
6
6
  list-style: none;
7
7
  }
@@ -1,21 +1,28 @@
1
1
  // Pagination
2
2
 
3
- @mixin pagination-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
3
+ @mixin pagination-size($padding-y, $padding-x, $font-size, $border-radius) {
4
4
  .page-link {
5
5
  padding: $padding-y $padding-x;
6
6
  @include font-size($font-size);
7
- line-height: $line-height;
8
7
  }
9
8
 
10
9
  .page-item {
11
- &:first-child {
12
- .page-link {
13
- @include border-left-radius($border-radius);
10
+ @if $pagination-margin-start == (-$pagination-border-width) {
11
+ &:first-child {
12
+ .page-link {
13
+ @include border-start-radius($border-radius);
14
+ }
14
15
  }
15
- }
16
- &:last-child {
16
+
17
+ &:last-child {
18
+ .page-link {
19
+ @include border-end-radius($border-radius);
20
+ }
21
+ }
22
+ } @else {
23
+ //Add border-radius to all pageLinks in case they have left margin
17
24
  .page-link {
18
- @include border-right-radius($border-radius);
25
+ @include border-radius($border-radius);
19
26
  }
20
27
  }
21
28
  }
@@ -1,6 +1,6 @@
1
- @mixin reset-text() {
1
+ @mixin reset-text {
2
2
  font-family: $font-family-base;
3
- // We deliberately do NOT reset font-size or word-wrap.
3
+ // We deliberately do NOT reset font-size or overflow-wrap / word-wrap.
4
4
  font-style: normal;
5
5
  font-weight: $font-weight-normal;
6
6
  line-height: $line-height-base;
@@ -0,0 +1,21 @@
1
+ // scss-docs-start table-variant
2
+ @mixin table-variant($state, $background) {
3
+ .table-#{$state} {
4
+ $color: color-contrast(opaque($body-bg, $background));
5
+ $hover-bg: mix($color, $background, percentage($table-hover-bg-factor));
6
+ $striped-bg: mix($color, $background, percentage($table-striped-bg-factor));
7
+ $active-bg: mix($color, $background, percentage($table-active-bg-factor));
8
+
9
+ --#{$variable-prefix}table-bg: #{$background};
10
+ --#{$variable-prefix}table-striped-bg: #{$striped-bg};
11
+ --#{$variable-prefix}table-striped-color: #{color-contrast($striped-bg)};
12
+ --#{$variable-prefix}table-active-bg: #{$active-bg};
13
+ --#{$variable-prefix}table-active-color: #{color-contrast($active-bg)};
14
+ --#{$variable-prefix}table-hover-bg: #{$hover-bg};
15
+ --#{$variable-prefix}table-hover-color: #{color-contrast($hover-bg)};
16
+
17
+ color: $color;
18
+ border-color: mix($color, $background, percentage($table-border-factor));
19
+ }
20
+ }
21
+ // scss-docs-end table-variant
@@ -17,7 +17,7 @@
17
17
  transition: $transition;
18
18
  }
19
19
 
20
- @if $enable-prefers-reduced-motion-media-query and nth($transition, 1) != null and nth($transition, 1) != none {
20
+ @if $enable-reduced-motion and nth($transition, 1) != null and nth($transition, 1) != none {
21
21
  @media (prefers-reduced-motion: reduce) {
22
22
  transition: none;
23
23
  }
@@ -0,0 +1,68 @@
1
+ // Utility generator
2
+ // Used to generate utilities & print utilities
3
+ @mixin generate-utility($utility, $infix, $is-rfs-media-query: false) {
4
+ $values: map-get($utility, values);
5
+
6
+ // If the values are a list or string, convert it into a map
7
+ @if type-of($values) == "string" or type-of(nth($values, 1)) != "list" {
8
+ $values: zip($values, $values);
9
+ }
10
+
11
+ @each $key, $value in $values {
12
+ $properties: map-get($utility, property);
13
+
14
+ // Multiple properties are possible, for example with vertical or horizontal margins or paddings
15
+ @if type-of($properties) == "string" {
16
+ $properties: append((), $properties);
17
+ }
18
+
19
+ // Use custom class if present
20
+ $property-class: if(map-has-key($utility, class), map-get($utility, class), nth($properties, 1));
21
+ $property-class: if($property-class == null, "", $property-class);
22
+
23
+ // State params to generate pseudo-classes
24
+ $state: if(map-has-key($utility, state), map-get($utility, state), ());
25
+
26
+ $infix: if($property-class == "" and str-slice($infix, 1, 1) == "-", str-slice($infix, 2), $infix);
27
+
28
+ // Don't prefix if value key is null (eg. with shadow class)
29
+ $property-class-modifier: if($key, if($property-class == "" and $infix == "", "", "-") + $key, "");
30
+
31
+ @if map-get($utility, rfs) {
32
+ // Inside the media query
33
+ @if $is-rfs-media-query {
34
+ $val: rfs-value($value);
35
+
36
+ // Do not render anything if fluid and non fluid values are the same
37
+ $value: if($val == rfs-fluid-value($value), null, $val);
38
+ }
39
+ @else {
40
+ $value: rfs-fluid-value($value);
41
+ }
42
+ }
43
+
44
+ $is-rtl: map-get($utility, rtl);
45
+
46
+ @if $value != null {
47
+ @if $is-rtl == false {
48
+ /* rtl:begin:remove */
49
+ }
50
+ .#{$property-class + $infix + $property-class-modifier} {
51
+ @each $property in $properties {
52
+ #{$property}: $value if($enable-important-utilities, !important, null);
53
+ }
54
+ }
55
+
56
+ @each $pseudo in $state {
57
+ .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
58
+ @each $property in $properties {
59
+ #{$property}: $value if($enable-important-utilities, !important, null);
60
+ }
61
+ }
62
+ }
63
+ @if $is-rtl == false {
64
+ /* rtl:end:remove */
65
+ }
66
+ }
67
+ }
68
+ }
@@ -0,0 +1,29 @@
1
+ // stylelint-disable declaration-no-important
2
+
3
+ // Hide content visually while keeping it accessible to assistive technologies
4
+ //
5
+ // See: https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/
6
+ // See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
7
+
8
+ @mixin visually-hidden() {
9
+ position: absolute !important;
10
+ width: 1px !important;
11
+ height: 1px !important;
12
+ padding: 0 !important;
13
+ margin: -1px !important; // Fix for https://github.com/twbs/bootstrap/issues/25686
14
+ overflow: hidden !important;
15
+ clip: rect(0, 0, 0, 0) !important;
16
+ white-space: nowrap !important;
17
+ border: 0 !important;
18
+ }
19
+
20
+ // Use to only display content when it's focused, or one of its child elements is focused
21
+ // (i.e. when focus is within the element/container that the class was applied to)
22
+ //
23
+ // Useful for "Skip to main content" links; see https://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
24
+
25
+ @mixin visually-hidden-focusable() {
26
+ &:not(:focus):not(:focus-within) {
27
+ @include visually-hidden();
28
+ }
29
+ }
@@ -0,0 +1,47 @@
1
+ // Loop over each breakpoint
2
+ @each $breakpoint in map-keys($grid-breakpoints) {
3
+
4
+ // Generate media query if needed
5
+ @include media-breakpoint-up($breakpoint) {
6
+ $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
7
+
8
+ // Loop over each utility property
9
+ @each $key, $utility in $utilities {
10
+ // The utility can be disabled with `false`, thus check if the utility is a map first
11
+ // Only proceed if responsive media queries are enabled or if it's the base media query
12
+ @if type-of($utility) == "map" and (map-get($utility, responsive) or $infix == "") {
13
+ @include generate-utility($utility, $infix);
14
+ }
15
+ }
16
+ }
17
+ }
18
+
19
+ // RFS rescaling
20
+ @media (min-width: $rfs-mq-value) {
21
+ @each $breakpoint in map-keys($grid-breakpoints) {
22
+ $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
23
+
24
+ @if (map-get($grid-breakpoints, $breakpoint) < $rfs-breakpoint) {
25
+ // Loop over each utility property
26
+ @each $key, $utility in $utilities {
27
+ // The utility can be disabled with `false`, thus check if the utility is a map first
28
+ // Only proceed if responsive media queries are enabled or if it's the base media query
29
+ @if type-of($utility) == "map" and map-get($utility, rfs) and (map-get($utility, responsive) or $infix == "") {
30
+ @include generate-utility($utility, $infix, true);
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+
37
+
38
+ // Print utilities
39
+ @media print {
40
+ @each $key, $utility in $utilities {
41
+ // The utility can be disabled with `false`, thus check if the utility is a map first
42
+ // Then check if the utility needs print styles
43
+ @if type-of($utility) == "map" and map-get($utility, print) == true {
44
+ @include generate-utility($utility, "-print");
45
+ }
46
+ }
47
+ }