bootstrap 5.1.3 → 5.3.5

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 (127) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +61 -0
  3. data/CHANGELOG.md +9 -0
  4. data/Gemfile +1 -0
  5. data/README.md +35 -14
  6. data/Rakefile +16 -5
  7. data/assets/javascripts/bootstrap/alert.js +22 -167
  8. data/assets/javascripts/bootstrap/base-component.js +34 -133
  9. data/assets/javascripts/bootstrap/button.js +19 -86
  10. data/assets/javascripts/bootstrap/carousel.js +209 -564
  11. data/assets/javascripts/bootstrap/collapse.js +78 -324
  12. data/assets/javascripts/bootstrap/dom/data.js +8 -14
  13. data/assets/javascripts/bootstrap/dom/event-handler.js +89 -174
  14. data/assets/javascripts/bootstrap/dom/manipulator.js +22 -39
  15. data/assets/javascripts/bootstrap/dom/selector-engine.js +47 -71
  16. data/assets/javascripts/bootstrap/dropdown.js +135 -420
  17. data/assets/javascripts/bootstrap/modal.js +115 -837
  18. data/assets/javascripts/bootstrap/offcanvas.js +93 -714
  19. data/assets/javascripts/bootstrap/popover.js +42 -130
  20. data/assets/javascripts/bootstrap/scrollspy.js +180 -296
  21. data/assets/javascripts/bootstrap/tab.js +197 -245
  22. data/assets/javascripts/bootstrap/toast.js +52 -276
  23. data/assets/javascripts/bootstrap/tooltip.js +283 -744
  24. data/assets/javascripts/bootstrap/util/backdrop.js +138 -0
  25. data/assets/javascripts/bootstrap/util/component-functions.js +41 -0
  26. data/assets/javascripts/bootstrap/util/config.js +67 -0
  27. data/assets/javascripts/bootstrap/util/focustrap.js +112 -0
  28. data/assets/javascripts/bootstrap/util/index.js +280 -0
  29. data/assets/javascripts/bootstrap/util/sanitizer.js +113 -0
  30. data/assets/javascripts/bootstrap/util/scrollbar.js +112 -0
  31. data/assets/javascripts/bootstrap/util/swipe.js +134 -0
  32. data/assets/javascripts/bootstrap/util/template-factory.js +150 -0
  33. data/assets/javascripts/bootstrap-global-this-define.js +1 -1
  34. data/assets/javascripts/bootstrap-sprockets.js +15 -6
  35. data/assets/javascripts/bootstrap.js +2278 -2831
  36. data/assets/javascripts/bootstrap.min.js +3 -3
  37. data/assets/stylesheets/_bootstrap-grid.scss +4 -9
  38. data/assets/stylesheets/_bootstrap-reboot.scss +4 -7
  39. data/assets/stylesheets/_bootstrap-utilities.scss +19 -0
  40. data/assets/stylesheets/_bootstrap.scss +5 -6
  41. data/assets/stylesheets/bootstrap/_accordion.scss +68 -33
  42. data/assets/stylesheets/bootstrap/_alert.scss +25 -14
  43. data/assets/stylesheets/bootstrap/_badge.scss +14 -5
  44. data/assets/stylesheets/bootstrap/_breadcrumb.scss +22 -10
  45. data/assets/stylesheets/bootstrap/_button-group.scss +12 -4
  46. data/assets/stylesheets/bootstrap/_buttons.scss +133 -28
  47. data/assets/stylesheets/bootstrap/_card.scss +61 -39
  48. data/assets/stylesheets/bootstrap/_carousel.scss +22 -25
  49. data/assets/stylesheets/bootstrap/_close.scss +36 -10
  50. data/assets/stylesheets/bootstrap/_containers.scss +1 -1
  51. data/assets/stylesheets/bootstrap/_dropdown.scss +86 -76
  52. data/assets/stylesheets/bootstrap/_functions.scss +10 -10
  53. data/assets/stylesheets/bootstrap/_grid.scss +9 -3
  54. data/assets/stylesheets/bootstrap/_helpers.scss +3 -0
  55. data/assets/stylesheets/bootstrap/_list-group.scss +81 -56
  56. data/assets/stylesheets/bootstrap/_maps.scss +174 -0
  57. data/assets/stylesheets/bootstrap/_mixins.scss +1 -2
  58. data/assets/stylesheets/bootstrap/_modal.scss +76 -45
  59. data/assets/stylesheets/bootstrap/_nav.scss +87 -29
  60. data/assets/stylesheets/bootstrap/_navbar.scss +102 -148
  61. data/assets/stylesheets/bootstrap/_offcanvas.scss +125 -61
  62. data/assets/stylesheets/bootstrap/_pagination.scss +66 -21
  63. data/assets/stylesheets/bootstrap/_placeholders.scss +1 -1
  64. data/assets/stylesheets/bootstrap/_popover.scss +90 -52
  65. data/assets/stylesheets/bootstrap/_progress.scss +31 -11
  66. data/assets/stylesheets/bootstrap/_reboot.scss +32 -46
  67. data/assets/stylesheets/bootstrap/_root.scss +155 -22
  68. data/assets/stylesheets/bootstrap/_spinners.scss +38 -22
  69. data/assets/stylesheets/bootstrap/_tables.scss +40 -24
  70. data/assets/stylesheets/bootstrap/_toasts.scss +38 -16
  71. data/assets/stylesheets/bootstrap/_tooltip.scss +60 -56
  72. data/assets/stylesheets/bootstrap/_type.scss +3 -1
  73. data/assets/stylesheets/bootstrap/_utilities.scss +209 -33
  74. data/assets/stylesheets/bootstrap/_variables-dark.scss +102 -0
  75. data/assets/stylesheets/bootstrap/_variables.scss +415 -303
  76. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +39 -5
  77. data/assets/stylesheets/bootstrap/forms/_form-check.scss +51 -14
  78. data/assets/stylesheets/bootstrap/forms/_form-control.scss +36 -41
  79. data/assets/stylesheets/bootstrap/forms/_form-range.scss +3 -3
  80. data/assets/stylesheets/bootstrap/forms/_form-select.scss +12 -4
  81. data/assets/stylesheets/bootstrap/forms/_input-group.scss +20 -9
  82. data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +7 -0
  83. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +20 -2
  84. data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
  85. data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -0
  86. data/assets/stylesheets/bootstrap/helpers/_position.scss +7 -1
  87. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +2 -2
  88. data/assets/stylesheets/bootstrap/helpers/_vr.scss +2 -2
  89. data/assets/stylesheets/bootstrap/mixins/_alert.scss +11 -4
  90. data/assets/stylesheets/bootstrap/mixins/_banner.scss +7 -0
  91. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +8 -8
  92. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +32 -95
  93. data/assets/stylesheets/bootstrap/mixins/_caret.scss +30 -25
  94. data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
  95. data/assets/stylesheets/bootstrap/mixins/_container.scss +4 -2
  96. data/assets/stylesheets/bootstrap/mixins/_forms.scss +38 -19
  97. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +1 -1
  98. data/assets/stylesheets/bootstrap/mixins/_grid.scss +15 -15
  99. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +2 -0
  100. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +4 -25
  101. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  102. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +12 -9
  103. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +14 -6
  104. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +6 -2
  105. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +23 -29
  106. data/bootstrap.gemspec +3 -3
  107. data/lib/bootstrap/engine.rb +17 -2
  108. data/lib/bootstrap/version.rb +2 -2
  109. data/tasks/updater/js.rb +10 -5
  110. data/tasks/updater/network.rb +2 -2
  111. data/tasks/updater/scss.rb +2 -2
  112. data/tasks/updater.rb +2 -2
  113. data/test/dummy_rails/config/application.rb +0 -2
  114. data/test/dummy_rails/public/favicon.ico +0 -0
  115. data/test/gemfiles/rails_4_2.gemfile +2 -1
  116. data/test/gemfiles/rails_5_0.gemfile +1 -2
  117. data/test/gemfiles/rails_5_1.gemfile +1 -2
  118. data/test/gemfiles/rails_5_2.gemfile +7 -0
  119. data/test/gemfiles/rails_6_0.gemfile +1 -1
  120. data/test/gemfiles/rails_6_1.gemfile +1 -1
  121. data/test/gemfiles/rails_7_0_dartsass.gemfile +7 -0
  122. data/test/gemfiles/rails_7_0_sassc.gemfile +7 -0
  123. data/test/rails_test.rb +0 -5
  124. data/test/test_helper.rb +3 -2
  125. metadata +49 -29
  126. data/.travis.yml +0 -32
  127. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +0 -18
@@ -3,53 +3,46 @@
3
3
  // Easily usable on <ul>, <ol>, or <div>.
4
4
 
5
5
  .list-group {
6
+ // scss-docs-start list-group-css-vars
7
+ --#{$prefix}list-group-color: #{$list-group-color};
8
+ --#{$prefix}list-group-bg: #{$list-group-bg};
9
+ --#{$prefix}list-group-border-color: #{$list-group-border-color};
10
+ --#{$prefix}list-group-border-width: #{$list-group-border-width};
11
+ --#{$prefix}list-group-border-radius: #{$list-group-border-radius};
12
+ --#{$prefix}list-group-item-padding-x: #{$list-group-item-padding-x};
13
+ --#{$prefix}list-group-item-padding-y: #{$list-group-item-padding-y};
14
+ --#{$prefix}list-group-action-color: #{$list-group-action-color};
15
+ --#{$prefix}list-group-action-hover-color: #{$list-group-action-hover-color};
16
+ --#{$prefix}list-group-action-hover-bg: #{$list-group-hover-bg};
17
+ --#{$prefix}list-group-action-active-color: #{$list-group-action-active-color};
18
+ --#{$prefix}list-group-action-active-bg: #{$list-group-action-active-bg};
19
+ --#{$prefix}list-group-disabled-color: #{$list-group-disabled-color};
20
+ --#{$prefix}list-group-disabled-bg: #{$list-group-disabled-bg};
21
+ --#{$prefix}list-group-active-color: #{$list-group-active-color};
22
+ --#{$prefix}list-group-active-bg: #{$list-group-active-bg};
23
+ --#{$prefix}list-group-active-border-color: #{$list-group-active-border-color};
24
+ // scss-docs-end list-group-css-vars
25
+
6
26
  display: flex;
7
27
  flex-direction: column;
8
28
 
9
29
  // No need to set list-style: none; since .list-group-item is block level
10
30
  padding-left: 0; // reset padding because ul and ol
11
31
  margin-bottom: 0;
12
- @include border-radius($list-group-border-radius);
32
+ @include border-radius(var(--#{$prefix}list-group-border-radius));
13
33
  }
14
34
 
15
35
  .list-group-numbered {
16
36
  list-style-type: none;
17
37
  counter-reset: section;
18
38
 
19
- > li::before {
39
+ > .list-group-item::before {
20
40
  // Increments only this instance of the section counter
21
41
  content: counters(section, ".") ". ";
22
42
  counter-increment: section;
23
43
  }
24
44
  }
25
45
 
26
-
27
- // Interactive list items
28
- //
29
- // Use anchor or button elements instead of `li`s or `div`s to create interactive
30
- // list items. Includes an extra `.active` modifier class for selected items.
31
-
32
- .list-group-item-action {
33
- width: 100%; // For `<button>`s (anchors become 100% by default though)
34
- color: $list-group-action-color;
35
- text-align: inherit; // For `<button>`s (anchors inherit)
36
-
37
- // Hover state
38
- &:hover,
39
- &:focus {
40
- z-index: 1; // Place hover/focus items above their siblings for proper border styling
41
- color: $list-group-action-hover-color;
42
- text-decoration: none;
43
- background-color: $list-group-hover-bg;
44
- }
45
-
46
- &:active {
47
- color: $list-group-action-active-color;
48
- background-color: $list-group-action-active-bg;
49
- }
50
- }
51
-
52
-
53
46
  // Individual list items
54
47
  //
55
48
  // Use on `li`s or `div`s within the `.list-group` parent.
@@ -57,11 +50,11 @@
57
50
  .list-group-item {
58
51
  position: relative;
59
52
  display: block;
60
- padding: $list-group-item-padding-y $list-group-item-padding-x;
61
- color: $list-group-color;
53
+ padding: var(--#{$prefix}list-group-item-padding-y) var(--#{$prefix}list-group-item-padding-x);
54
+ color: var(--#{$prefix}list-group-color);
62
55
  text-decoration: if($link-decoration == none, null, none);
63
- background-color: $list-group-bg;
64
- border: $list-group-border-width solid $list-group-border-color;
56
+ background-color: var(--#{$prefix}list-group-bg);
57
+ border: var(--#{$prefix}list-group-border-width) solid var(--#{$prefix}list-group-border-color);
65
58
 
66
59
  &:first-child {
67
60
  @include border-top-radius(inherit);
@@ -73,29 +66,56 @@
73
66
 
74
67
  &.disabled,
75
68
  &:disabled {
76
- color: $list-group-disabled-color;
69
+ color: var(--#{$prefix}list-group-disabled-color);
77
70
  pointer-events: none;
78
- background-color: $list-group-disabled-bg;
71
+ background-color: var(--#{$prefix}list-group-disabled-bg);
79
72
  }
80
73
 
81
74
  // Include both here for `<a>`s and `<button>`s
82
75
  &.active {
83
76
  z-index: 2; // Place active items above their siblings for proper border styling
84
- color: $list-group-active-color;
85
- background-color: $list-group-active-bg;
86
- border-color: $list-group-active-border-color;
77
+ color: var(--#{$prefix}list-group-active-color);
78
+ background-color: var(--#{$prefix}list-group-active-bg);
79
+ border-color: var(--#{$prefix}list-group-active-border-color);
87
80
  }
88
81
 
89
- & + & {
82
+ // stylelint-disable-next-line scss/selector-no-redundant-nesting-selector
83
+ & + .list-group-item {
90
84
  border-top-width: 0;
91
85
 
92
86
  &.active {
93
- margin-top: -$list-group-border-width;
94
- border-top-width: $list-group-border-width;
87
+ margin-top: calc(-1 * var(--#{$prefix}list-group-border-width)); // stylelint-disable-line function-disallowed-list
88
+ border-top-width: var(--#{$prefix}list-group-border-width);
95
89
  }
96
90
  }
97
91
  }
98
92
 
93
+ // Interactive list items
94
+ //
95
+ // Use anchor or button elements instead of `li`s or `div`s to create interactive
96
+ // list items. Includes an extra `.active` modifier class for selected items.
97
+
98
+ .list-group-item-action {
99
+ width: 100%; // For `<button>`s (anchors become 100% by default though)
100
+ color: var(--#{$prefix}list-group-action-color);
101
+ text-align: inherit; // For `<button>`s (anchors inherit)
102
+
103
+ &:not(.active) {
104
+ // Hover state
105
+ &:hover,
106
+ &:focus {
107
+ z-index: 1; // Place hover/focus items above their siblings for proper border styling
108
+ color: var(--#{$prefix}list-group-action-hover-color);
109
+ text-decoration: none;
110
+ background-color: var(--#{$prefix}list-group-action-hover-bg);
111
+ }
112
+
113
+ &:active {
114
+ color: var(--#{$prefix}list-group-action-active-color);
115
+ background-color: var(--#{$prefix}list-group-action-active-bg);
116
+ }
117
+ }
118
+ }
99
119
 
100
120
  // Horizontal
101
121
  //
@@ -109,13 +129,13 @@
109
129
  flex-direction: row;
110
130
 
111
131
  > .list-group-item {
112
- &:first-child {
113
- @include border-bottom-start-radius($list-group-border-radius);
132
+ &:first-child:not(:last-child) {
133
+ @include border-bottom-start-radius(var(--#{$prefix}list-group-border-radius));
114
134
  @include border-top-end-radius(0);
115
135
  }
116
136
 
117
- &:last-child {
118
- @include border-top-end-radius($list-group-border-radius);
137
+ &:last-child:not(:first-child) {
138
+ @include border-top-end-radius(var(--#{$prefix}list-group-border-radius));
119
139
  @include border-bottom-start-radius(0);
120
140
  }
121
141
 
@@ -124,12 +144,12 @@
124
144
  }
125
145
 
126
146
  + .list-group-item {
127
- border-top-width: $list-group-border-width;
147
+ border-top-width: var(--#{$prefix}list-group-border-width);
128
148
  border-left-width: 0;
129
149
 
130
150
  &.active {
131
- margin-left: -$list-group-border-width;
132
- border-left-width: $list-group-border-width;
151
+ margin-left: calc(-1 * var(--#{$prefix}list-group-border-width)); // stylelint-disable-line function-disallowed-list
152
+ border-left-width: var(--#{$prefix}list-group-border-width);
133
153
  }
134
154
  }
135
155
  }
@@ -147,7 +167,7 @@
147
167
  @include border-radius(0);
148
168
 
149
169
  > .list-group-item {
150
- border-width: 0 0 $list-group-border-width;
170
+ border-width: 0 0 var(--#{$prefix}list-group-border-width);
151
171
 
152
172
  &:last-child {
153
173
  border-bottom-width: 0;
@@ -162,13 +182,18 @@
162
182
  // Add modifier classes to change text and background color on individual items.
163
183
  // Organizationally, this must come after the `:hover` states.
164
184
 
165
- @each $state, $value in $theme-colors {
166
- $list-group-variant-bg: shift-color($value, $list-group-item-bg-scale);
167
- $list-group-variant-color: shift-color($value, $list-group-item-color-scale);
168
- @if (contrast-ratio($list-group-variant-bg, $list-group-variant-color) < $min-contrast-ratio) {
169
- $list-group-variant-color: mix($value, color-contrast($list-group-variant-bg), abs($list-group-item-color-scale));
185
+ @each $state in map-keys($theme-colors) {
186
+ .list-group-item-#{$state} {
187
+ --#{$prefix}list-group-color: var(--#{$prefix}#{$state}-text-emphasis);
188
+ --#{$prefix}list-group-bg: var(--#{$prefix}#{$state}-bg-subtle);
189
+ --#{$prefix}list-group-border-color: var(--#{$prefix}#{$state}-border-subtle);
190
+ --#{$prefix}list-group-action-hover-color: var(--#{$prefix}emphasis-color);
191
+ --#{$prefix}list-group-action-hover-bg: var(--#{$prefix}#{$state}-border-subtle);
192
+ --#{$prefix}list-group-action-active-color: var(--#{$prefix}emphasis-color);
193
+ --#{$prefix}list-group-action-active-bg: var(--#{$prefix}#{$state}-border-subtle);
194
+ --#{$prefix}list-group-active-color: var(--#{$prefix}#{$state}-bg-subtle);
195
+ --#{$prefix}list-group-active-bg: var(--#{$prefix}#{$state}-text-emphasis);
196
+ --#{$prefix}list-group-active-border-color: var(--#{$prefix}#{$state}-text-emphasis);
170
197
  }
171
-
172
- @include list-group-item-variant($state, $list-group-variant-bg, $list-group-variant-color);
173
198
  }
174
199
  // scss-docs-end list-group-modifiers
@@ -0,0 +1,174 @@
1
+ // Re-assigned maps
2
+ //
3
+ // Placed here so that others can override the default Sass maps and see automatic updates to utilities and more.
4
+
5
+ // scss-docs-start theme-colors-rgb
6
+ $theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value") !default;
7
+ // scss-docs-end theme-colors-rgb
8
+
9
+ // scss-docs-start theme-text-map
10
+ $theme-colors-text: (
11
+ "primary": $primary-text-emphasis,
12
+ "secondary": $secondary-text-emphasis,
13
+ "success": $success-text-emphasis,
14
+ "info": $info-text-emphasis,
15
+ "warning": $warning-text-emphasis,
16
+ "danger": $danger-text-emphasis,
17
+ "light": $light-text-emphasis,
18
+ "dark": $dark-text-emphasis,
19
+ ) !default;
20
+ // scss-docs-end theme-text-map
21
+
22
+ // scss-docs-start theme-bg-subtle-map
23
+ $theme-colors-bg-subtle: (
24
+ "primary": $primary-bg-subtle,
25
+ "secondary": $secondary-bg-subtle,
26
+ "success": $success-bg-subtle,
27
+ "info": $info-bg-subtle,
28
+ "warning": $warning-bg-subtle,
29
+ "danger": $danger-bg-subtle,
30
+ "light": $light-bg-subtle,
31
+ "dark": $dark-bg-subtle,
32
+ ) !default;
33
+ // scss-docs-end theme-bg-subtle-map
34
+
35
+ // scss-docs-start theme-border-subtle-map
36
+ $theme-colors-border-subtle: (
37
+ "primary": $primary-border-subtle,
38
+ "secondary": $secondary-border-subtle,
39
+ "success": $success-border-subtle,
40
+ "info": $info-border-subtle,
41
+ "warning": $warning-border-subtle,
42
+ "danger": $danger-border-subtle,
43
+ "light": $light-border-subtle,
44
+ "dark": $dark-border-subtle,
45
+ ) !default;
46
+ // scss-docs-end theme-border-subtle-map
47
+
48
+ $theme-colors-text-dark: null !default;
49
+ $theme-colors-bg-subtle-dark: null !default;
50
+ $theme-colors-border-subtle-dark: null !default;
51
+
52
+ @if $enable-dark-mode {
53
+ // scss-docs-start theme-text-dark-map
54
+ $theme-colors-text-dark: (
55
+ "primary": $primary-text-emphasis-dark,
56
+ "secondary": $secondary-text-emphasis-dark,
57
+ "success": $success-text-emphasis-dark,
58
+ "info": $info-text-emphasis-dark,
59
+ "warning": $warning-text-emphasis-dark,
60
+ "danger": $danger-text-emphasis-dark,
61
+ "light": $light-text-emphasis-dark,
62
+ "dark": $dark-text-emphasis-dark,
63
+ ) !default;
64
+ // scss-docs-end theme-text-dark-map
65
+
66
+ // scss-docs-start theme-bg-subtle-dark-map
67
+ $theme-colors-bg-subtle-dark: (
68
+ "primary": $primary-bg-subtle-dark,
69
+ "secondary": $secondary-bg-subtle-dark,
70
+ "success": $success-bg-subtle-dark,
71
+ "info": $info-bg-subtle-dark,
72
+ "warning": $warning-bg-subtle-dark,
73
+ "danger": $danger-bg-subtle-dark,
74
+ "light": $light-bg-subtle-dark,
75
+ "dark": $dark-bg-subtle-dark,
76
+ ) !default;
77
+ // scss-docs-end theme-bg-subtle-dark-map
78
+
79
+ // scss-docs-start theme-border-subtle-dark-map
80
+ $theme-colors-border-subtle-dark: (
81
+ "primary": $primary-border-subtle-dark,
82
+ "secondary": $secondary-border-subtle-dark,
83
+ "success": $success-border-subtle-dark,
84
+ "info": $info-border-subtle-dark,
85
+ "warning": $warning-border-subtle-dark,
86
+ "danger": $danger-border-subtle-dark,
87
+ "light": $light-border-subtle-dark,
88
+ "dark": $dark-border-subtle-dark,
89
+ ) !default;
90
+ // scss-docs-end theme-border-subtle-dark-map
91
+ }
92
+
93
+ // Utilities maps
94
+ //
95
+ // Extends the default `$theme-colors` maps to help create our utilities.
96
+
97
+ // Come v6, we'll de-dupe these variables. Until then, for backward compatibility, we keep them to reassign.
98
+ // scss-docs-start utilities-colors
99
+ $utilities-colors: $theme-colors-rgb !default;
100
+ // scss-docs-end utilities-colors
101
+
102
+ // scss-docs-start utilities-text-colors
103
+ $utilities-text: map-merge(
104
+ $utilities-colors,
105
+ (
106
+ "black": to-rgb($black),
107
+ "white": to-rgb($white),
108
+ "body": to-rgb($body-color)
109
+ )
110
+ ) !default;
111
+ $utilities-text-colors: map-loop($utilities-text, rgba-css-var, "$key", "text") !default;
112
+
113
+ $utilities-text-emphasis-colors: (
114
+ "primary-emphasis": var(--#{$prefix}primary-text-emphasis),
115
+ "secondary-emphasis": var(--#{$prefix}secondary-text-emphasis),
116
+ "success-emphasis": var(--#{$prefix}success-text-emphasis),
117
+ "info-emphasis": var(--#{$prefix}info-text-emphasis),
118
+ "warning-emphasis": var(--#{$prefix}warning-text-emphasis),
119
+ "danger-emphasis": var(--#{$prefix}danger-text-emphasis),
120
+ "light-emphasis": var(--#{$prefix}light-text-emphasis),
121
+ "dark-emphasis": var(--#{$prefix}dark-text-emphasis)
122
+ ) !default;
123
+ // scss-docs-end utilities-text-colors
124
+
125
+ // scss-docs-start utilities-bg-colors
126
+ $utilities-bg: map-merge(
127
+ $utilities-colors,
128
+ (
129
+ "black": to-rgb($black),
130
+ "white": to-rgb($white),
131
+ "body": to-rgb($body-bg)
132
+ )
133
+ ) !default;
134
+ $utilities-bg-colors: map-loop($utilities-bg, rgba-css-var, "$key", "bg") !default;
135
+
136
+ $utilities-bg-subtle: (
137
+ "primary-subtle": var(--#{$prefix}primary-bg-subtle),
138
+ "secondary-subtle": var(--#{$prefix}secondary-bg-subtle),
139
+ "success-subtle": var(--#{$prefix}success-bg-subtle),
140
+ "info-subtle": var(--#{$prefix}info-bg-subtle),
141
+ "warning-subtle": var(--#{$prefix}warning-bg-subtle),
142
+ "danger-subtle": var(--#{$prefix}danger-bg-subtle),
143
+ "light-subtle": var(--#{$prefix}light-bg-subtle),
144
+ "dark-subtle": var(--#{$prefix}dark-bg-subtle)
145
+ ) !default;
146
+ // scss-docs-end utilities-bg-colors
147
+
148
+ // scss-docs-start utilities-border-colors
149
+ $utilities-border: map-merge(
150
+ $utilities-colors,
151
+ (
152
+ "black": to-rgb($black),
153
+ "white": to-rgb($white)
154
+ )
155
+ ) !default;
156
+ $utilities-border-colors: map-loop($utilities-border, rgba-css-var, "$key", "border") !default;
157
+
158
+ $utilities-border-subtle: (
159
+ "primary-subtle": var(--#{$prefix}primary-border-subtle),
160
+ "secondary-subtle": var(--#{$prefix}secondary-border-subtle),
161
+ "success-subtle": var(--#{$prefix}success-border-subtle),
162
+ "info-subtle": var(--#{$prefix}info-border-subtle),
163
+ "warning-subtle": var(--#{$prefix}warning-border-subtle),
164
+ "danger-subtle": var(--#{$prefix}danger-border-subtle),
165
+ "light-subtle": var(--#{$prefix}light-border-subtle),
166
+ "dark-subtle": var(--#{$prefix}dark-border-subtle)
167
+ ) !default;
168
+ // scss-docs-end utilities-border-colors
169
+
170
+ $utilities-links-underline: map-loop($utilities-colors, rgba-css-var, "$key", "link-underline") !default;
171
+
172
+ $negative-spacers: if($enable-negative-margins, negativify-map($spacers), null) !default;
173
+
174
+ $gutters: $spacers !default;
@@ -10,6 +10,7 @@
10
10
 
11
11
  // Helpers
12
12
  @import "mixins/breakpoints";
13
+ @import "mixins/color-mode";
13
14
  @import "mixins/color-scheme";
14
15
  @import "mixins/image";
15
16
  @import "mixins/resize";
@@ -21,13 +22,11 @@
21
22
  @import "mixins/utilities";
22
23
 
23
24
  // Components
24
- @import "mixins/alert";
25
25
  @import "mixins/backdrop";
26
26
  @import "mixins/buttons";
27
27
  @import "mixins/caret";
28
28
  @import "mixins/pagination";
29
29
  @import "mixins/lists";
30
- @import "mixins/list-group";
31
30
  @import "mixins/forms";
32
31
  @import "mixins/table-variants";
33
32
 
@@ -1,3 +1,5 @@
1
+ // stylelint-disable function-disallowed-list
2
+
1
3
  // .modal-open - body class for killing the scroll
2
4
  // .modal - container to scroll within
3
5
  // .modal-dialog - positioning shell for the actual modal
@@ -6,10 +8,34 @@
6
8
 
7
9
  // Container that the modal scrolls within
8
10
  .modal {
11
+ // scss-docs-start modal-css-vars
12
+ --#{$prefix}modal-zindex: #{$zindex-modal};
13
+ --#{$prefix}modal-width: #{$modal-md};
14
+ --#{$prefix}modal-padding: #{$modal-inner-padding};
15
+ --#{$prefix}modal-margin: #{$modal-dialog-margin};
16
+ --#{$prefix}modal-color: #{$modal-content-color};
17
+ --#{$prefix}modal-bg: #{$modal-content-bg};
18
+ --#{$prefix}modal-border-color: #{$modal-content-border-color};
19
+ --#{$prefix}modal-border-width: #{$modal-content-border-width};
20
+ --#{$prefix}modal-border-radius: #{$modal-content-border-radius};
21
+ --#{$prefix}modal-box-shadow: #{$modal-content-box-shadow-xs};
22
+ --#{$prefix}modal-inner-border-radius: #{$modal-content-inner-border-radius};
23
+ --#{$prefix}modal-header-padding-x: #{$modal-header-padding-x};
24
+ --#{$prefix}modal-header-padding-y: #{$modal-header-padding-y};
25
+ --#{$prefix}modal-header-padding: #{$modal-header-padding}; // Todo in v6: Split this padding into x and y
26
+ --#{$prefix}modal-header-border-color: #{$modal-header-border-color};
27
+ --#{$prefix}modal-header-border-width: #{$modal-header-border-width};
28
+ --#{$prefix}modal-title-line-height: #{$modal-title-line-height};
29
+ --#{$prefix}modal-footer-gap: #{$modal-footer-margin-between};
30
+ --#{$prefix}modal-footer-bg: #{$modal-footer-bg};
31
+ --#{$prefix}modal-footer-border-color: #{$modal-footer-border-color};
32
+ --#{$prefix}modal-footer-border-width: #{$modal-footer-border-width};
33
+ // scss-docs-end modal-css-vars
34
+
9
35
  position: fixed;
10
36
  top: 0;
11
37
  left: 0;
12
- z-index: $zindex-modal;
38
+ z-index: var(--#{$prefix}modal-zindex);
13
39
  display: none;
14
40
  width: 100%;
15
41
  height: 100%;
@@ -27,14 +53,14 @@
27
53
  .modal-dialog {
28
54
  position: relative;
29
55
  width: auto;
30
- margin: $modal-dialog-margin;
56
+ margin: var(--#{$prefix}modal-margin);
31
57
  // allow clicks to pass through for custom click handling to close modal
32
58
  pointer-events: none;
33
59
 
34
60
  // When fading in the modal, animate it to slide down
35
61
  .modal.fade & {
36
- @include transition($modal-transition);
37
62
  transform: $modal-fade-transform;
63
+ @include transition($modal-transition);
38
64
  }
39
65
  .modal.show & {
40
66
  transform: $modal-show-transform;
@@ -47,7 +73,7 @@
47
73
  }
48
74
 
49
75
  .modal-dialog-scrollable {
50
- height: subtract(100%, $modal-dialog-margin * 2);
76
+ height: calc(100% - var(--#{$prefix}modal-margin) * 2);
51
77
 
52
78
  .modal-content {
53
79
  max-height: 100%;
@@ -62,7 +88,7 @@
62
88
  .modal-dialog-centered {
63
89
  display: flex;
64
90
  align-items: center;
65
- min-height: subtract(100%, $modal-dialog-margin * 2);
91
+ min-height: calc(100% - var(--#{$prefix}modal-margin) * 2);
66
92
  }
67
93
 
68
94
  // Actual modal
@@ -72,20 +98,26 @@
72
98
  flex-direction: column;
73
99
  width: 100%; // Ensure `.modal-content` extends the full width of the parent `.modal-dialog`
74
100
  // counteract the pointer-events: none; in the .modal-dialog
75
- color: $modal-content-color;
101
+ color: var(--#{$prefix}modal-color);
76
102
  pointer-events: auto;
77
- background-color: $modal-content-bg;
103
+ background-color: var(--#{$prefix}modal-bg);
78
104
  background-clip: padding-box;
79
- border: $modal-content-border-width solid $modal-content-border-color;
80
- @include border-radius($modal-content-border-radius);
81
- @include box-shadow($modal-content-box-shadow-xs);
105
+ border: var(--#{$prefix}modal-border-width) solid var(--#{$prefix}modal-border-color);
106
+ @include border-radius(var(--#{$prefix}modal-border-radius));
107
+ @include box-shadow(var(--#{$prefix}modal-box-shadow));
82
108
  // Remove focus outline from opened modal
83
109
  outline: 0;
84
110
  }
85
111
 
86
112
  // Modal background
87
113
  .modal-backdrop {
88
- @include overlay-backdrop($zindex-modal-backdrop, $modal-backdrop-bg, $modal-backdrop-opacity);
114
+ // scss-docs-start modal-backdrop-css-vars
115
+ --#{$prefix}backdrop-zindex: #{$zindex-modal-backdrop};
116
+ --#{$prefix}backdrop-bg: #{$modal-backdrop-bg};
117
+ --#{$prefix}backdrop-opacity: #{$modal-backdrop-opacity};
118
+ // scss-docs-end modal-backdrop-css-vars
119
+
120
+ @include overlay-backdrop(var(--#{$prefix}backdrop-zindex), var(--#{$prefix}backdrop-bg), var(--#{$prefix}backdrop-opacity));
89
121
  }
90
122
 
91
123
  // Modal header
@@ -94,21 +126,24 @@
94
126
  display: flex;
95
127
  flex-shrink: 0;
96
128
  align-items: center;
97
- justify-content: space-between; // Put modal header elements (title and dismiss) on opposite ends
98
- padding: $modal-header-padding;
99
- border-bottom: $modal-header-border-width solid $modal-header-border-color;
100
- @include border-top-radius($modal-content-inner-border-radius);
129
+ padding: var(--#{$prefix}modal-header-padding);
130
+ border-bottom: var(--#{$prefix}modal-header-border-width) solid var(--#{$prefix}modal-header-border-color);
131
+ @include border-top-radius(var(--#{$prefix}modal-inner-border-radius));
101
132
 
102
133
  .btn-close {
103
- padding: ($modal-header-padding-y * .5) ($modal-header-padding-x * .5);
104
- margin: ($modal-header-padding-y * -.5) ($modal-header-padding-x * -.5) ($modal-header-padding-y * -.5) auto;
134
+ padding: calc(var(--#{$prefix}modal-header-padding-y) * .5) calc(var(--#{$prefix}modal-header-padding-x) * .5);
135
+ // Split properties to avoid invalid calc() function if value is 0
136
+ margin-top: calc(-.5 * var(--#{$prefix}modal-header-padding-y));
137
+ margin-right: calc(-.5 * var(--#{$prefix}modal-header-padding-x));
138
+ margin-bottom: calc(-.5 * var(--#{$prefix}modal-header-padding-y));
139
+ margin-left: auto;
105
140
  }
106
141
  }
107
142
 
108
143
  // Title text within header
109
144
  .modal-title {
110
145
  margin-bottom: 0;
111
- line-height: $modal-title-line-height;
146
+ line-height: var(--#{$prefix}modal-title-line-height);
112
147
  }
113
148
 
114
149
  // Modal body
@@ -118,60 +153,59 @@
118
153
  // Enable `flex-grow: 1` so that the body take up as much space as possible
119
154
  // when there should be a fixed height on `.modal-dialog`.
120
155
  flex: 1 1 auto;
121
- padding: $modal-inner-padding;
156
+ padding: var(--#{$prefix}modal-padding);
122
157
  }
123
158
 
124
159
  // Footer (for actions)
125
160
  .modal-footer {
126
161
  display: flex;
127
- flex-wrap: wrap;
128
162
  flex-shrink: 0;
163
+ flex-wrap: wrap;
129
164
  align-items: center; // vertically center
130
165
  justify-content: flex-end; // Right align buttons with flex property because text-align doesn't work on flex items
131
- padding: $modal-inner-padding - $modal-footer-margin-between * .5;
132
- border-top: $modal-footer-border-width solid $modal-footer-border-color;
133
- @include border-bottom-radius($modal-content-inner-border-radius);
166
+ padding: calc(var(--#{$prefix}modal-padding) - var(--#{$prefix}modal-footer-gap) * .5);
167
+ background-color: var(--#{$prefix}modal-footer-bg);
168
+ border-top: var(--#{$prefix}modal-footer-border-width) solid var(--#{$prefix}modal-footer-border-color);
169
+ @include border-bottom-radius(var(--#{$prefix}modal-inner-border-radius));
134
170
 
135
171
  // Place margin between footer elements
136
172
  // This solution is far from ideal because of the universal selector usage,
137
173
  // but is needed to fix https://github.com/twbs/bootstrap/issues/24800
138
174
  > * {
139
- margin: $modal-footer-margin-between * .5;
175
+ margin: calc(var(--#{$prefix}modal-footer-gap) * .5); // Todo in v6: replace with gap on parent class
140
176
  }
141
177
  }
142
178
 
143
179
  // Scale up the modal
144
180
  @include media-breakpoint-up(sm) {
145
- // Automatically set modal's width for larger viewports
146
- .modal-dialog {
147
- max-width: $modal-md;
148
- margin: $modal-dialog-margin-y-sm-up auto;
149
- }
150
-
151
- .modal-dialog-scrollable {
152
- height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);
181
+ .modal {
182
+ --#{$prefix}modal-margin: #{$modal-dialog-margin-y-sm-up};
183
+ --#{$prefix}modal-box-shadow: #{$modal-content-box-shadow-sm-up};
153
184
  }
154
185
 
155
- .modal-dialog-centered {
156
- min-height: subtract(100%, $modal-dialog-margin-y-sm-up * 2);
186
+ // Automatically set modal's width for larger viewports
187
+ .modal-dialog {
188
+ max-width: var(--#{$prefix}modal-width);
189
+ margin-right: auto;
190
+ margin-left: auto;
157
191
  }
158
192
 
159
- .modal-content {
160
- @include box-shadow($modal-content-box-shadow-sm-up);
193
+ .modal-sm {
194
+ --#{$prefix}modal-width: #{$modal-sm};
161
195
  }
162
-
163
- .modal-sm { max-width: $modal-sm; }
164
196
  }
165
197
 
166
198
  @include media-breakpoint-up(lg) {
167
199
  .modal-lg,
168
200
  .modal-xl {
169
- max-width: $modal-lg;
201
+ --#{$prefix}modal-width: #{$modal-lg};
170
202
  }
171
203
  }
172
204
 
173
205
  @include media-breakpoint-up(xl) {
174
- .modal-xl { max-width: $modal-xl; }
206
+ .modal-xl {
207
+ --#{$prefix}modal-width: #{$modal-xl};
208
+ }
175
209
  }
176
210
 
177
211
  // scss-docs-start modal-fullscreen-loop
@@ -192,17 +226,14 @@
192
226
  @include border-radius(0);
193
227
  }
194
228
 
195
- .modal-header {
229
+ .modal-header,
230
+ .modal-footer {
196
231
  @include border-radius(0);
197
232
  }
198
233
 
199
234
  .modal-body {
200
235
  overflow-y: auto;
201
236
  }
202
-
203
- .modal-footer {
204
- @include border-radius(0);
205
- }
206
237
  }
207
238
  }
208
239
  }