bootstrap 4.3.1 → 5.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +17 -2
  3. data/CHANGELOG.md +2 -14
  4. data/README.md +7 -4
  5. data/assets/javascripts/bootstrap/alert.js +172 -136
  6. data/assets/javascripts/bootstrap/base-component.js +182 -0
  7. data/assets/javascripts/bootstrap/button.js +101 -142
  8. data/assets/javascripts/bootstrap/carousel.js +483 -408
  9. data/assets/javascripts/bootstrap/collapse.js +340 -273
  10. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  11. data/assets/javascripts/bootstrap/dom/event-handler.js +321 -0
  12. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  13. data/assets/javascripts/bootstrap/dom/selector-engine.js +127 -0
  14. data/assets/javascripts/bootstrap/dropdown.js +491 -399
  15. data/assets/javascripts/bootstrap/modal.js +841 -449
  16. data/assets/javascripts/bootstrap/offcanvas.js +866 -0
  17. data/assets/javascripts/bootstrap/popover.js +121 -198
  18. data/assets/javascripts/bootstrap/scrollspy.js +256 -240
  19. data/assets/javascripts/bootstrap/tab.js +218 -154
  20. data/assets/javascripts/bootstrap/toast.js +329 -189
  21. data/assets/javascripts/bootstrap/tooltip.js +651 -552
  22. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  23. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  24. data/assets/javascripts/bootstrap-sprockets.js +8 -1
  25. data/assets/javascripts/bootstrap.js +3503 -2892
  26. data/assets/javascripts/bootstrap.min.js +4 -4
  27. data/assets/stylesheets/_bootstrap-grid.scss +56 -18
  28. data/assets/stylesheets/_bootstrap-reboot.scss +5 -4
  29. data/assets/stylesheets/_bootstrap.scss +20 -11
  30. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  31. data/assets/stylesheets/bootstrap/_alert.scss +15 -9
  32. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  33. data/assets/stylesheets/bootstrap/_breadcrumb.scss +5 -18
  34. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  35. data/assets/stylesheets/bootstrap/_buttons.scss +28 -54
  36. data/assets/stylesheets/bootstrap/_card.scss +52 -125
  37. data/assets/stylesheets/bootstrap/_carousel.scss +70 -38
  38. data/assets/stylesheets/bootstrap/_close.scss +30 -31
  39. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  40. data/assets/stylesheets/bootstrap/_dropdown.scss +88 -39
  41. data/assets/stylesheets/bootstrap/_forms.scss +9 -330
  42. data/assets/stylesheets/bootstrap/_functions.scss +243 -27
  43. data/assets/stylesheets/bootstrap/_grid.scss +14 -33
  44. data/assets/stylesheets/bootstrap/_helpers.scss +9 -0
  45. data/assets/stylesheets/bootstrap/_images.scss +3 -3
  46. data/assets/stylesheets/bootstrap/_list-group.scss +61 -36
  47. data/assets/stylesheets/bootstrap/_mixins.scss +12 -16
  48. data/assets/stylesheets/bootstrap/_modal.scss +64 -84
  49. data/assets/stylesheets/bootstrap/_nav.scss +29 -10
  50. data/assets/stylesheets/bootstrap/_navbar.scss +93 -52
  51. data/assets/stylesheets/bootstrap/_offcanvas.scss +83 -0
  52. data/assets/stylesheets/bootstrap/_pagination.scss +13 -22
  53. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  54. data/assets/stylesheets/bootstrap/_popover.scss +29 -42
  55. data/assets/stylesheets/bootstrap/_progress.scss +10 -5
  56. data/assets/stylesheets/bootstrap/_reboot.scss +350 -208
  57. data/assets/stylesheets/bootstrap/_root.scss +43 -8
  58. data/assets/stylesheets/bootstrap/_spinners.scss +21 -7
  59. data/assets/stylesheets/bootstrap/_tables.scss +84 -114
  60. data/assets/stylesheets/bootstrap/_toasts.scss +21 -14
  61. data/assets/stylesheets/bootstrap/_tooltip.scss +21 -21
  62. data/assets/stylesheets/bootstrap/_transitions.scss +8 -1
  63. data/assets/stylesheets/bootstrap/_type.scss +40 -61
  64. data/assets/stylesheets/bootstrap/_utilities.scss +630 -17
  65. data/assets/stylesheets/bootstrap/_variables.scss +1007 -489
  66. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  67. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +63 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  70. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  71. data/assets/stylesheets/bootstrap/forms/_form-select.scss +72 -0
  72. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  73. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  74. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  75. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  76. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  77. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  78. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  79. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  80. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  81. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  82. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  83. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  84. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  85. data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
  86. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  87. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +37 -22
  88. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  89. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  90. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +77 -51
  91. data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
  92. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  93. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  94. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  95. data/assets/stylesheets/bootstrap/mixins/_forms.scss +67 -115
  96. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  97. data/assets/stylesheets/bootstrap/mixins/_grid.scss +132 -32
  98. data/assets/stylesheets/bootstrap/mixins/_image.scss +0 -20
  99. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
  100. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
  101. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  102. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  103. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  104. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +89 -0
  105. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  106. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  107. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +278 -128
  108. data/bootstrap.gemspec +4 -6
  109. data/lib/bootstrap/version.rb +2 -2
  110. data/tasks/updater/js.rb +25 -6
  111. data/tasks/updater/network.rb +8 -2
  112. data/test/dummy_rails/app/assets/config/manifest.js +3 -0
  113. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  114. data/test/dummy_rails/app/assets/stylesheets/.browserslistrc +1 -0
  115. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  116. data/test/dummy_rails/app/views/pages/root.html +89 -0
  117. data/test/dummy_rails/config/application.rb +0 -3
  118. data/test/gemfiles/rails_6_0.gemfile +7 -0
  119. data/test/gemfiles/rails_6_1.gemfile +7 -0
  120. data/test/support/dummy_rails_integration.rb +3 -1
  121. data/test/test_helper.rb +18 -13
  122. metadata +61 -79
  123. data/assets/javascripts/bootstrap/util.js +0 -171
  124. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  125. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -507
  126. data/assets/stylesheets/bootstrap/_input-group.scss +0 -193
  127. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  128. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  129. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  130. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -21
  131. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  132. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  133. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -66
  134. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  135. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -10
  136. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -33
  137. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  138. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  139. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -16
  140. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  141. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  142. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  143. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  144. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  145. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  146. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  147. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  148. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  149. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  150. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  151. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  152. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  153. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  154. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  155. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  156. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  157. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  158. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
@@ -1,51 +1,151 @@
1
- /// Grid system
1
+ // Grid system
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
-
14
- // For each breakpoint, define the maximum width of the container in a media query
15
- @mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {
16
- @each $breakpoint, $container-max-width in $max-widths {
17
- @include media-breakpoint-up($breakpoint, $breakpoints) {
18
- max-width: $container-max-width;
19
- }
20
- }
21
- }
22
-
23
5
  @mixin make-row($gutter: $grid-gutter-width) {
6
+ --#{$variable-prefix}gutter-x: #{$gutter};
7
+ --#{$variable-prefix}gutter-y: 0;
24
8
  display: flex;
25
9
  flex-wrap: wrap;
26
- margin-right: -$gutter / 2;
27
- margin-left: -$gutter / 2;
10
+ // TODO: Revisit calc order after https://github.com/react-bootstrap/react-bootstrap/issues/6039 is fixed
11
+ margin-top: calc(-1 * var(--#{$variable-prefix}gutter-y)); // stylelint-disable-line function-disallowed-list
12
+ margin-right: calc(-.5 * var(--#{$variable-prefix}gutter-x)); // stylelint-disable-line function-disallowed-list
13
+ margin-left: calc(-.5 * var(--#{$variable-prefix}gutter-x)); // stylelint-disable-line function-disallowed-list
28
14
  }
29
15
 
30
16
  @mixin make-col-ready($gutter: $grid-gutter-width) {
31
- position: relative;
17
+ // Add box sizing if only the grid is loaded
18
+ box-sizing: if(variable-exists(include-column-box-sizing) and $include-column-box-sizing, border-box, null);
32
19
  // Prevent columns from becoming too narrow when at smaller grid tiers by
33
- // always setting `width: 100%;`. This works because we use `flex` values
20
+ // always setting `width: 100%;`. This works because we set the width
34
21
  // later on to override this initial width.
22
+ flex-shrink: 0;
35
23
  width: 100%;
36
- padding-right: $gutter / 2;
37
- padding-left: $gutter / 2;
24
+ max-width: 100%; // Prevent `.col-auto`, `.col` (& responsive variants) from breaking out the grid
25
+ padding-right: calc(var(--#{$variable-prefix}gutter-x) * .5); // stylelint-disable-line function-disallowed-list
26
+ padding-left: calc(var(--#{$variable-prefix}gutter-x) * .5); // stylelint-disable-line function-disallowed-list
27
+ margin-top: var(--#{$variable-prefix}gutter-y);
28
+ }
29
+
30
+ @mixin make-col($size: false, $columns: $grid-columns) {
31
+ @if $size {
32
+ flex: 0 0 auto;
33
+ width: percentage(divide($size, $columns));
34
+
35
+ } @else {
36
+ flex: 1 1 0;
37
+ max-width: 100%;
38
+ }
38
39
  }
39
40
 
40
- @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);
41
+ @mixin make-col-auto() {
42
+ flex: 0 0 auto;
43
+ width: auto;
46
44
  }
47
45
 
48
46
  @mixin make-col-offset($size, $columns: $grid-columns) {
49
- $num: $size / $columns;
47
+ $num: divide($size, $columns);
50
48
  margin-left: if($num == 0, 0, percentage($num));
51
49
  }
50
+
51
+ // Row columns
52
+ //
53
+ // Specify on a parent element(e.g., .row) to force immediate children into NN
54
+ // numberof columns. Supports wrapping to new lines, but does not do a Masonry
55
+ // style grid.
56
+ @mixin row-cols($count) {
57
+ > * {
58
+ flex: 0 0 auto;
59
+ width: divide(100%, $count);
60
+ }
61
+ }
62
+
63
+ // Framework grid generation
64
+ //
65
+ // Used only by Bootstrap to generate the correct number of grid classes given
66
+ // any value of `$grid-columns`.
67
+
68
+ @mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {
69
+ @each $breakpoint in map-keys($breakpoints) {
70
+ $infix: breakpoint-infix($breakpoint, $breakpoints);
71
+
72
+ @include media-breakpoint-up($breakpoint, $breakpoints) {
73
+ // Provide basic `.col-{bp}` classes for equal-width flexbox columns
74
+ .col#{$infix} {
75
+ flex: 1 0 0%; // Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4
76
+ }
77
+
78
+ .row-cols#{$infix}-auto > * {
79
+ @include make-col-auto();
80
+ }
81
+
82
+ @if $grid-row-columns > 0 {
83
+ @for $i from 1 through $grid-row-columns {
84
+ .row-cols#{$infix}-#{$i} {
85
+ @include row-cols($i);
86
+ }
87
+ }
88
+ }
89
+
90
+ .col#{$infix}-auto {
91
+ @include make-col-auto();
92
+ }
93
+
94
+ @if $columns > 0 {
95
+ @for $i from 1 through $columns {
96
+ .col#{$infix}-#{$i} {
97
+ @include make-col($i, $columns);
98
+ }
99
+ }
100
+
101
+ // `$columns - 1` because offsetting by the width of an entire row isn't possible
102
+ @for $i from 0 through ($columns - 1) {
103
+ @if not ($infix == "" and $i == 0) { // Avoid emitting useless .offset-0
104
+ .offset#{$infix}-#{$i} {
105
+ @include make-col-offset($i, $columns);
106
+ }
107
+ }
108
+ }
109
+ }
110
+
111
+ // Gutters
112
+ //
113
+ // Make use of `.g-*`, `.gx-*` or `.gy-*` utilities to change spacing between the columns.
114
+ @each $key, $value in $gutters {
115
+ .g#{$infix}-#{$key},
116
+ .gx#{$infix}-#{$key} {
117
+ --#{$variable-prefix}gutter-x: #{$value};
118
+ }
119
+
120
+ .g#{$infix}-#{$key},
121
+ .gy#{$infix}-#{$key} {
122
+ --#{$variable-prefix}gutter-y: #{$value};
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+
129
+ @mixin make-cssgrid($columns: $grid-columns, $breakpoints: $grid-breakpoints) {
130
+ @each $breakpoint in map-keys($breakpoints) {
131
+ $infix: breakpoint-infix($breakpoint, $breakpoints);
132
+
133
+ @include media-breakpoint-up($breakpoint, $breakpoints) {
134
+ @if $columns > 0 {
135
+ @for $i from 1 through $columns {
136
+ .g-col#{$infix}-#{$i} {
137
+ grid-column: auto / span $i;
138
+ }
139
+ }
140
+
141
+ // Start with `1` because `0` is and invalid value.
142
+ // Ends with `$columns - 1` because offsetting by the width of an entire row isn't possible.
143
+ @for $i from 1 through ($columns - 1) {
144
+ .g-start#{$infix}-#{$i} {
145
+ grid-column-start: $i;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
151
+ }
@@ -14,23 +14,3 @@
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/#feat=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
- }
@@ -1,14 +1,16 @@
1
1
  // List Groups
2
2
 
3
+ // scss-docs-start list-group-mixin
3
4
  @mixin list-group-item-variant($state, $background, $color) {
4
5
  .list-group-item-#{$state} {
5
6
  color: $color;
6
7
  background-color: $background;
7
8
 
8
9
  &.list-group-item-action {
9
- @include hover-focus {
10
+ &:hover,
11
+ &:focus {
10
12
  color: $color;
11
- background-color: darken($background, 5%);
13
+ background-color: shade-color($background, 10%);
12
14
  }
13
15
 
14
16
  &.active {
@@ -19,3 +21,4 @@
19
21
  }
20
22
  }
21
23
  }
24
+ // scss-docs-end list-group-mixin
@@ -1,22 +1,31 @@
1
1
  // Pagination
2
2
 
3
- @mixin pagination-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
3
+ // scss-docs-start pagination-mixin
4
+ @mixin pagination-size($padding-y, $padding-x, $font-size, $border-radius) {
4
5
  .page-link {
5
6
  padding: $padding-y $padding-x;
6
7
  @include font-size($font-size);
7
- line-height: $line-height;
8
8
  }
9
9
 
10
10
  .page-item {
11
- &:first-child {
12
- .page-link {
13
- @include border-left-radius($border-radius);
11
+ @if $pagination-margin-start == (-$pagination-border-width) {
12
+ &:first-child {
13
+ .page-link {
14
+ @include border-start-radius($border-radius);
15
+ }
14
16
  }
15
- }
16
- &:last-child {
17
+
18
+ &:last-child {
19
+ .page-link {
20
+ @include border-end-radius($border-radius);
21
+ }
22
+ }
23
+ } @else {
24
+ //Add border-radius to all pageLinks in case they have left margin
17
25
  .page-link {
18
- @include border-right-radius($border-radius);
26
+ @include border-radius($border-radius);
19
27
  }
20
28
  }
21
29
  }
22
30
  }
31
+ // scss-docs-end pagination-mixin
@@ -1,6 +1,6 @@
1
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
@@ -1,16 +1,26 @@
1
- // stylelint-disable property-blacklist
1
+ // stylelint-disable property-disallowed-list
2
2
  @mixin transition($transition...) {
3
+ @if length($transition) == 0 {
4
+ $transition: $transition-base;
5
+ }
6
+
7
+ @if length($transition) > 1 {
8
+ @each $value in $transition {
9
+ @if $value == null or $value == none {
10
+ @warn "The keyword 'none' or 'null' must be used as a single argument.";
11
+ }
12
+ }
13
+ }
14
+
3
15
  @if $enable-transitions {
4
- @if length($transition) == 0 {
5
- transition: $transition-base;
6
- } @else {
16
+ @if nth($transition, 1) != null {
7
17
  transition: $transition;
8
18
  }
9
- }
10
19
 
11
- @if $enable-prefers-reduced-motion-media-query {
12
- @media (prefers-reduced-motion: reduce) {
13
- transition: none;
20
+ @if $enable-reduced-motion and nth($transition, 1) != null and nth($transition, 1) != none {
21
+ @media (prefers-reduced-motion: reduce) {
22
+ transition: none;
23
+ }
14
24
  }
15
25
  }
16
26
  }
@@ -0,0 +1,89 @@
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-css-var: map-get($utility, css-var);
45
+ $is-local-vars: map-get($utility, local-vars);
46
+ $is-rtl: map-get($utility, rtl);
47
+
48
+ @if $value != null {
49
+ @if $is-rtl == false {
50
+ /* rtl:begin:remove */
51
+ }
52
+
53
+ @if $is-css-var {
54
+ .#{$property-class + $infix + $property-class-modifier} {
55
+ --#{$variable-prefix}#{$property-class}: #{$value};
56
+ }
57
+
58
+ @each $pseudo in $state {
59
+ .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
60
+ --#{$variable-prefix}#{$property-class}: #{$value};
61
+ }
62
+ }
63
+ } @else {
64
+ .#{$property-class + $infix + $property-class-modifier} {
65
+ @each $property in $properties {
66
+ @if $is-local-vars {
67
+ @each $local-var, $value in $is-local-vars {
68
+ --#{$variable-prefix}#{$local-var}: #{$value};
69
+ }
70
+ }
71
+ #{$property}: $value if($enable-important-utilities, !important, null);
72
+ }
73
+ }
74
+
75
+ @each $pseudo in $state {
76
+ .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
77
+ @each $property in $properties {
78
+ #{$property}: $value if($enable-important-utilities, !important, null);
79
+ }
80
+ }
81
+ }
82
+ }
83
+
84
+ @if $is-rtl == false {
85
+ /* rtl:end:remove */
86
+ }
87
+ }
88
+ }
89
+ }
@@ -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://kittygiraudel.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
+ }