bootstrap 4.6.2.1 → 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 (186) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +61 -0
  3. data/CHANGELOG.md +7 -2
  4. data/Gemfile +1 -0
  5. data/README.md +33 -15
  6. data/Rakefile +1 -2
  7. data/assets/javascripts/bootstrap/alert.js +50 -147
  8. data/assets/javascripts/bootstrap/base-component.js +83 -0
  9. data/assets/javascripts/bootstrap/button.js +40 -190
  10. data/assets/javascripts/bootstrap/carousel.js +282 -537
  11. data/assets/javascripts/bootstrap/collapse.js +166 -314
  12. data/assets/javascripts/bootstrap/dom/data.js +62 -0
  13. data/assets/javascripts/bootstrap/dom/event-handler.js +236 -0
  14. data/assets/javascripts/bootstrap/dom/manipulator.js +71 -0
  15. data/assets/javascripts/bootstrap/dom/selector-engine.js +103 -0
  16. data/assets/javascripts/bootstrap/dropdown.js +297 -455
  17. data/assets/javascripts/bootstrap/modal.js +223 -566
  18. data/assets/javascripts/bootstrap/offcanvas.js +245 -0
  19. data/assets/javascripts/bootstrap/popover.js +59 -208
  20. data/assets/javascripts/bootstrap/scrollspy.js +213 -276
  21. data/assets/javascripts/bootstrap/tab.js +222 -200
  22. data/assets/javascripts/bootstrap/toast.js +137 -206
  23. data/assets/javascripts/bootstrap/tooltip.js +403 -747
  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 +6 -0
  34. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  35. data/assets/javascripts/bootstrap-sprockets.js +21 -5
  36. data/assets/javascripts/bootstrap.js +3625 -3488
  37. data/assets/javascripts/bootstrap.min.js +3 -3
  38. data/assets/stylesheets/_bootstrap-grid.scss +53 -21
  39. data/assets/stylesheets/_bootstrap-reboot.scss +5 -7
  40. data/assets/stylesheets/_bootstrap-utilities.scss +19 -0
  41. data/assets/stylesheets/_bootstrap.scss +21 -13
  42. data/assets/stylesheets/bootstrap/_accordion.scss +153 -0
  43. data/assets/stylesheets/bootstrap/_alert.scss +32 -16
  44. data/assets/stylesheets/bootstrap/_badge.scss +15 -31
  45. data/assets/stylesheets/bootstrap/_breadcrumb.scss +22 -24
  46. data/assets/stylesheets/bootstrap/_button-group.scss +32 -48
  47. data/assets/stylesheets/bootstrap/_buttons.scss +145 -71
  48. data/assets/stylesheets/bootstrap/_card.scss +67 -115
  49. data/assets/stylesheets/bootstrap/_carousel.scss +63 -37
  50. data/assets/stylesheets/bootstrap/_close.scss +53 -27
  51. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  52. data/assets/stylesheets/bootstrap/_dropdown.scss +129 -71
  53. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  54. data/assets/stylesheets/bootstrap/_functions.scss +135 -23
  55. data/assets/stylesheets/bootstrap/_grid.scss +18 -52
  56. data/assets/stylesheets/bootstrap/_helpers.scss +12 -0
  57. data/assets/stylesheets/bootstrap/_list-group.scss +93 -48
  58. data/assets/stylesheets/bootstrap/_maps.scss +174 -0
  59. data/assets/stylesheets/bootstrap/_mixins.scss +10 -15
  60. data/assets/stylesheets/bootstrap/_modal.scss +112 -112
  61. data/assets/stylesheets/bootstrap/_nav.scss +100 -28
  62. data/assets/stylesheets/bootstrap/_navbar.scss +130 -173
  63. data/assets/stylesheets/bootstrap/_offcanvas.scss +147 -0
  64. data/assets/stylesheets/bootstrap/_pagination.scss +72 -37
  65. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  66. data/assets/stylesheets/bootstrap/_popover.scss +99 -73
  67. data/assets/stylesheets/bootstrap/_progress.scss +35 -14
  68. data/assets/stylesheets/bootstrap/_reboot.scss +319 -192
  69. data/assets/stylesheets/bootstrap/_root.scss +177 -9
  70. data/assets/stylesheets/bootstrap/_spinners.scss +43 -23
  71. data/assets/stylesheets/bootstrap/_tables.scss +101 -115
  72. data/assets/stylesheets/bootstrap/_toasts.scss +54 -27
  73. data/assets/stylesheets/bootstrap/_tooltip.scss +67 -63
  74. data/assets/stylesheets/bootstrap/_transitions.scss +3 -2
  75. data/assets/stylesheets/bootstrap/_type.scss +40 -59
  76. data/assets/stylesheets/bootstrap/_utilities.scss +806 -18
  77. data/assets/stylesheets/bootstrap/_variables-dark.scss +102 -0
  78. data/assets/stylesheets/bootstrap/_variables.scss +1210 -606
  79. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +97 -0
  80. data/assets/stylesheets/bootstrap/forms/_form-check.scss +189 -0
  81. data/assets/stylesheets/bootstrap/forms/_form-control.scss +214 -0
  82. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  83. data/assets/stylesheets/bootstrap/forms/_form-select.scss +80 -0
  84. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  85. data/assets/stylesheets/bootstrap/forms/_input-group.scss +132 -0
  86. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  87. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  88. data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +7 -0
  89. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +30 -0
  90. data/assets/stylesheets/bootstrap/helpers/_focus-ring.scss +5 -0
  91. data/assets/stylesheets/bootstrap/helpers/_icon-link.scss +25 -0
  92. data/assets/stylesheets/bootstrap/helpers/_position.scss +36 -0
  93. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  94. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  95. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  96. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  97. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  98. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  99. data/assets/stylesheets/bootstrap/mixins/_alert.scss +11 -6
  100. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  101. data/assets/stylesheets/bootstrap/mixins/_banner.scss +7 -0
  102. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +10 -8
  103. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  104. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +20 -16
  105. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +60 -100
  106. data/assets/stylesheets/bootstrap/mixins/_caret.scss +34 -27
  107. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  108. data/assets/stylesheets/bootstrap/mixins/_color-mode.scss +21 -0
  109. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  110. data/assets/stylesheets/bootstrap/mixins/_container.scss +11 -0
  111. data/assets/stylesheets/bootstrap/mixins/_forms.scss +64 -96
  112. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  113. data/assets/stylesheets/bootstrap/mixins/_grid.scss +118 -36
  114. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  115. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +7 -2
  116. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  117. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +7 -19
  118. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  119. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +24 -0
  120. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  121. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +97 -0
  122. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +33 -0
  123. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  124. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +211 -91
  125. data/bootstrap.gemspec +6 -6
  126. data/lib/bootstrap/engine.rb +0 -1
  127. data/lib/bootstrap/version.rb +2 -2
  128. data/tasks/updater/js.rb +17 -5
  129. data/tasks/updater/network.rb +2 -2
  130. data/tasks/updater/scss.rb +2 -2
  131. data/tasks/updater.rb +2 -2
  132. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  133. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  134. data/test/dummy_rails/app/views/pages/root.html +89 -0
  135. data/test/dummy_rails/config/application.rb +0 -5
  136. data/test/dummy_rails/public/favicon.ico +0 -0
  137. data/test/gemfiles/rails_4_2.gemfile +2 -1
  138. data/test/gemfiles/rails_5_0.gemfile +1 -2
  139. data/test/gemfiles/rails_5_1.gemfile +1 -2
  140. data/test/gemfiles/rails_5_2.gemfile +7 -0
  141. data/test/gemfiles/rails_6_0.gemfile +1 -1
  142. data/test/gemfiles/rails_6_1.gemfile +7 -0
  143. data/test/gemfiles/rails_7_0_dartsass.gemfile +0 -1
  144. data/test/gemfiles/rails_7_0_sassc.gemfile +0 -1
  145. data/test/rails_test.rb +0 -5
  146. data/test/test_helper.rb +3 -2
  147. metadata +92 -86
  148. data/.travis.yml +0 -31
  149. data/assets/javascripts/bootstrap/util.js +0 -189
  150. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  151. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  152. data/assets/stylesheets/bootstrap/_input-group.scss +0 -211
  153. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  154. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  155. data/assets/stylesheets/bootstrap/_print.scss +0 -132
  156. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  157. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  158. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  159. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  160. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  161. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  162. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  163. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  164. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  165. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  166. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  167. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  168. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  169. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  170. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  171. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  172. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  173. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  174. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  175. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  176. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  177. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  178. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  179. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  180. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  181. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  182. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  183. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  184. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  185. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
  186. /data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
@@ -0,0 +1,97 @@
1
+ .form-floating {
2
+ position: relative;
3
+
4
+ > .form-control,
5
+ > .form-control-plaintext,
6
+ > .form-select {
7
+ height: $form-floating-height;
8
+ min-height: $form-floating-height;
9
+ line-height: $form-floating-line-height;
10
+ }
11
+
12
+ > label {
13
+ position: absolute;
14
+ top: 0;
15
+ left: 0;
16
+ z-index: 2;
17
+ max-width: 100%;
18
+ height: 100%; // allow textareas
19
+ padding: $form-floating-padding-y $form-floating-padding-x;
20
+ overflow: hidden;
21
+ color: rgba(var(--#{$prefix}body-color-rgb), #{$form-floating-label-opacity});
22
+ text-align: start;
23
+ text-overflow: ellipsis;
24
+ white-space: nowrap;
25
+ pointer-events: none;
26
+ border: $input-border-width solid transparent; // Required for aligning label's text with the input as it affects inner box model
27
+ transform-origin: 0 0;
28
+ @include transition($form-floating-transition);
29
+ }
30
+
31
+ > .form-control,
32
+ > .form-control-plaintext {
33
+ padding: $form-floating-padding-y $form-floating-padding-x;
34
+
35
+ &::placeholder {
36
+ color: transparent;
37
+ }
38
+
39
+ &:focus,
40
+ &:not(:placeholder-shown) {
41
+ padding-top: $form-floating-input-padding-t;
42
+ padding-bottom: $form-floating-input-padding-b;
43
+ }
44
+ // Duplicated because `:-webkit-autofill` invalidates other selectors when grouped
45
+ &:-webkit-autofill {
46
+ padding-top: $form-floating-input-padding-t;
47
+ padding-bottom: $form-floating-input-padding-b;
48
+ }
49
+ }
50
+
51
+ > .form-select {
52
+ padding-top: $form-floating-input-padding-t;
53
+ padding-bottom: $form-floating-input-padding-b;
54
+ padding-left: $form-floating-padding-x;
55
+ }
56
+
57
+ > .form-control:focus,
58
+ > .form-control:not(:placeholder-shown),
59
+ > .form-control-plaintext,
60
+ > .form-select {
61
+ ~ label {
62
+ transform: $form-floating-label-transform;
63
+ }
64
+ }
65
+ // Duplicated because `:-webkit-autofill` invalidates other selectors when grouped
66
+ > .form-control:-webkit-autofill {
67
+ ~ label {
68
+ transform: $form-floating-label-transform;
69
+ }
70
+ }
71
+ > textarea:focus,
72
+ > textarea:not(:placeholder-shown) {
73
+ ~ label::after {
74
+ position: absolute;
75
+ inset: $form-floating-padding-y ($form-floating-padding-x * .5);
76
+ z-index: -1;
77
+ height: $form-floating-label-height;
78
+ content: "";
79
+ background-color: $input-bg;
80
+ @include border-radius($input-border-radius);
81
+ }
82
+ }
83
+ > textarea:disabled ~ label::after {
84
+ background-color: $input-disabled-bg;
85
+ }
86
+
87
+ > .form-control-plaintext {
88
+ ~ label {
89
+ border-width: $input-border-width 0; // Required to properly position label text - as explained above
90
+ }
91
+ }
92
+
93
+ > :disabled ~ label,
94
+ > .form-control:disabled ~ label { // Required for `.form-control`s because of specificity
95
+ color: $form-floating-label-disabled-color;
96
+ }
97
+ }
@@ -0,0 +1,189 @@
1
+ //
2
+ // Check/radio
3
+ //
4
+
5
+ .form-check {
6
+ display: block;
7
+ min-height: $form-check-min-height;
8
+ padding-left: $form-check-padding-start;
9
+ margin-bottom: $form-check-margin-bottom;
10
+
11
+ .form-check-input {
12
+ float: left;
13
+ margin-left: $form-check-padding-start * -1;
14
+ }
15
+ }
16
+
17
+ .form-check-reverse {
18
+ padding-right: $form-check-padding-start;
19
+ padding-left: 0;
20
+ text-align: right;
21
+
22
+ .form-check-input {
23
+ float: right;
24
+ margin-right: $form-check-padding-start * -1;
25
+ margin-left: 0;
26
+ }
27
+ }
28
+
29
+ .form-check-input {
30
+ --#{$prefix}form-check-bg: #{$form-check-input-bg};
31
+
32
+ flex-shrink: 0;
33
+ width: $form-check-input-width;
34
+ height: $form-check-input-width;
35
+ margin-top: ($line-height-base - $form-check-input-width) * .5; // line-height minus check height
36
+ vertical-align: top;
37
+ appearance: none;
38
+ background-color: var(--#{$prefix}form-check-bg);
39
+ background-image: var(--#{$prefix}form-check-bg-image);
40
+ background-repeat: no-repeat;
41
+ background-position: center;
42
+ background-size: contain;
43
+ border: $form-check-input-border;
44
+ print-color-adjust: exact; // Keep themed appearance for print
45
+ @include transition($form-check-transition);
46
+
47
+ &[type="checkbox"] {
48
+ @include border-radius($form-check-input-border-radius);
49
+ }
50
+
51
+ &[type="radio"] {
52
+ // stylelint-disable-next-line property-disallowed-list
53
+ border-radius: $form-check-radio-border-radius;
54
+ }
55
+
56
+ &:active {
57
+ filter: $form-check-input-active-filter;
58
+ }
59
+
60
+ &:focus {
61
+ border-color: $form-check-input-focus-border;
62
+ outline: 0;
63
+ box-shadow: $form-check-input-focus-box-shadow;
64
+ }
65
+
66
+ &:checked {
67
+ background-color: $form-check-input-checked-bg-color;
68
+ border-color: $form-check-input-checked-border-color;
69
+
70
+ &[type="checkbox"] {
71
+ @if $enable-gradients {
72
+ --#{$prefix}form-check-bg-image: #{escape-svg($form-check-input-checked-bg-image)}, var(--#{$prefix}gradient);
73
+ } @else {
74
+ --#{$prefix}form-check-bg-image: #{escape-svg($form-check-input-checked-bg-image)};
75
+ }
76
+ }
77
+
78
+ &[type="radio"] {
79
+ @if $enable-gradients {
80
+ --#{$prefix}form-check-bg-image: #{escape-svg($form-check-radio-checked-bg-image)}, var(--#{$prefix}gradient);
81
+ } @else {
82
+ --#{$prefix}form-check-bg-image: #{escape-svg($form-check-radio-checked-bg-image)};
83
+ }
84
+ }
85
+ }
86
+
87
+ &[type="checkbox"]:indeterminate {
88
+ background-color: $form-check-input-indeterminate-bg-color;
89
+ border-color: $form-check-input-indeterminate-border-color;
90
+
91
+ @if $enable-gradients {
92
+ --#{$prefix}form-check-bg-image: #{escape-svg($form-check-input-indeterminate-bg-image)}, var(--#{$prefix}gradient);
93
+ } @else {
94
+ --#{$prefix}form-check-bg-image: #{escape-svg($form-check-input-indeterminate-bg-image)};
95
+ }
96
+ }
97
+
98
+ &:disabled {
99
+ pointer-events: none;
100
+ filter: none;
101
+ opacity: $form-check-input-disabled-opacity;
102
+ }
103
+
104
+ // Use disabled attribute in addition of :disabled pseudo-class
105
+ // See: https://github.com/twbs/bootstrap/issues/28247
106
+ &[disabled],
107
+ &:disabled {
108
+ ~ .form-check-label {
109
+ cursor: default;
110
+ opacity: $form-check-label-disabled-opacity;
111
+ }
112
+ }
113
+ }
114
+
115
+ .form-check-label {
116
+ color: $form-check-label-color;
117
+ cursor: $form-check-label-cursor;
118
+ }
119
+
120
+ //
121
+ // Switch
122
+ //
123
+
124
+ .form-switch {
125
+ padding-left: $form-switch-padding-start;
126
+
127
+ .form-check-input {
128
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image)};
129
+
130
+ width: $form-switch-width;
131
+ margin-left: $form-switch-padding-start * -1;
132
+ background-image: var(--#{$prefix}form-switch-bg);
133
+ background-position: left center;
134
+ @include border-radius($form-switch-border-radius, 0);
135
+ @include transition($form-switch-transition);
136
+
137
+ &:focus {
138
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-focus-bg-image)};
139
+ }
140
+
141
+ &:checked {
142
+ background-position: $form-switch-checked-bg-position;
143
+
144
+ @if $enable-gradients {
145
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-checked-bg-image)}, var(--#{$prefix}gradient);
146
+ } @else {
147
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-checked-bg-image)};
148
+ }
149
+ }
150
+ }
151
+
152
+ &.form-check-reverse {
153
+ padding-right: $form-switch-padding-start;
154
+ padding-left: 0;
155
+
156
+ .form-check-input {
157
+ margin-right: $form-switch-padding-start * -1;
158
+ margin-left: 0;
159
+ }
160
+ }
161
+ }
162
+
163
+ .form-check-inline {
164
+ display: inline-block;
165
+ margin-right: $form-check-inline-margin-end;
166
+ }
167
+
168
+ .btn-check {
169
+ position: absolute;
170
+ clip: rect(0, 0, 0, 0);
171
+ pointer-events: none;
172
+
173
+ &[disabled],
174
+ &:disabled {
175
+ + .btn {
176
+ pointer-events: none;
177
+ filter: none;
178
+ opacity: $form-check-btn-check-disabled-opacity;
179
+ }
180
+ }
181
+ }
182
+
183
+ @if $enable-dark-mode {
184
+ @include color-mode(dark) {
185
+ .form-switch .form-check-input:not(:checked):not(:focus) {
186
+ --#{$prefix}form-switch-bg: #{escape-svg($form-switch-bg-image-dark)};
187
+ }
188
+ }
189
+ }
@@ -0,0 +1,214 @@
1
+ //
2
+ // General form controls (plus a few specific high-level interventions)
3
+ //
4
+
5
+ .form-control {
6
+ display: block;
7
+ width: 100%;
8
+ padding: $input-padding-y $input-padding-x;
9
+ font-family: $input-font-family;
10
+ @include font-size($input-font-size);
11
+ font-weight: $input-font-weight;
12
+ line-height: $input-line-height;
13
+ color: $input-color;
14
+ appearance: none; // Fix appearance for date inputs in Safari
15
+ background-color: $input-bg;
16
+ background-clip: padding-box;
17
+ border: $input-border-width solid $input-border-color;
18
+
19
+ // Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
20
+ @include border-radius($input-border-radius, 0);
21
+
22
+ @include box-shadow($input-box-shadow);
23
+ @include transition($input-transition);
24
+
25
+ &[type="file"] {
26
+ overflow: hidden; // prevent pseudo element button overlap
27
+
28
+ &:not(:disabled):not([readonly]) {
29
+ cursor: pointer;
30
+ }
31
+ }
32
+
33
+ // Customize the `:focus` state to imitate native WebKit styles.
34
+ &:focus {
35
+ color: $input-focus-color;
36
+ background-color: $input-focus-bg;
37
+ border-color: $input-focus-border-color;
38
+ outline: 0;
39
+ @if $enable-shadows {
40
+ @include box-shadow($input-box-shadow, $input-focus-box-shadow);
41
+ } @else {
42
+ // Avoid using mixin so we can pass custom focus shadow properly
43
+ box-shadow: $input-focus-box-shadow;
44
+ }
45
+ }
46
+
47
+ &::-webkit-date-and-time-value {
48
+ // On Android Chrome, form-control's "width: 100%" makes the input width too small
49
+ // Tested under Android 11 / Chrome 89, Android 12 / Chrome 100, Android 13 / Chrome 109
50
+ //
51
+ // On iOS Safari, form-control's "appearance: none" + "width: 100%" makes the input width too small
52
+ // Tested under iOS 16.2 / Safari 16.2
53
+ min-width: 85px; // Seems to be a good minimum safe width
54
+
55
+ // Add some height to date inputs on iOS
56
+ // https://github.com/twbs/bootstrap/issues/23307
57
+ // TODO: we can remove this workaround once https://bugs.webkit.org/show_bug.cgi?id=198959 is resolved
58
+ // Multiply line-height by 1em if it has no unit
59
+ height: if(unit($input-line-height) == "", $input-line-height * 1em, $input-line-height);
60
+
61
+ // Android Chrome type="date" is taller than the other inputs
62
+ // because of "margin: 1px 24px 1px 4px" inside the shadow DOM
63
+ // Tested under Android 11 / Chrome 89, Android 12 / Chrome 100, Android 13 / Chrome 109
64
+ margin: 0;
65
+ }
66
+
67
+ // Prevent excessive date input height in Webkit
68
+ // https://github.com/twbs/bootstrap/issues/34433
69
+ &::-webkit-datetime-edit {
70
+ display: block;
71
+ padding: 0;
72
+ }
73
+
74
+ // Placeholder
75
+ &::placeholder {
76
+ color: $input-placeholder-color;
77
+ // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
78
+ opacity: 1;
79
+ }
80
+
81
+ // Disabled inputs
82
+ //
83
+ // HTML5 says that controls under a fieldset > legend:first-child won't be
84
+ // disabled if the fieldset is disabled. Due to implementation difficulty, we
85
+ // don't honor that edge case; we style them as disabled anyway.
86
+ &:disabled {
87
+ color: $input-disabled-color;
88
+ background-color: $input-disabled-bg;
89
+ border-color: $input-disabled-border-color;
90
+ // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
91
+ opacity: 1;
92
+ }
93
+
94
+ // File input buttons theming
95
+ &::file-selector-button {
96
+ padding: $input-padding-y $input-padding-x;
97
+ margin: (-$input-padding-y) (-$input-padding-x);
98
+ margin-inline-end: $input-padding-x;
99
+ color: $form-file-button-color;
100
+ @include gradient-bg($form-file-button-bg);
101
+ pointer-events: none;
102
+ border-color: inherit;
103
+ border-style: solid;
104
+ border-width: 0;
105
+ border-inline-end-width: $input-border-width;
106
+ border-radius: 0; // stylelint-disable-line property-disallowed-list
107
+ @include transition($btn-transition);
108
+ }
109
+
110
+ &:hover:not(:disabled):not([readonly])::file-selector-button {
111
+ background-color: $form-file-button-hover-bg;
112
+ }
113
+ }
114
+
115
+ // Readonly controls as plain text
116
+ //
117
+ // Apply class to a readonly input to make it appear like regular plain
118
+ // text (without any border, background color, focus indicator)
119
+
120
+ .form-control-plaintext {
121
+ display: block;
122
+ width: 100%;
123
+ padding: $input-padding-y 0;
124
+ margin-bottom: 0; // match inputs if this class comes on inputs with default margins
125
+ line-height: $input-line-height;
126
+ color: $input-plaintext-color;
127
+ background-color: transparent;
128
+ border: solid transparent;
129
+ border-width: $input-border-width 0;
130
+
131
+ &:focus {
132
+ outline: 0;
133
+ }
134
+
135
+ &.form-control-sm,
136
+ &.form-control-lg {
137
+ padding-right: 0;
138
+ padding-left: 0;
139
+ }
140
+ }
141
+
142
+ // Form control sizing
143
+ //
144
+ // Build on `.form-control` with modifier classes to decrease or increase the
145
+ // height and font-size of form controls.
146
+ //
147
+ // Repeated in `_input_group.scss` to avoid Sass extend issues.
148
+
149
+ .form-control-sm {
150
+ min-height: $input-height-sm;
151
+ padding: $input-padding-y-sm $input-padding-x-sm;
152
+ @include font-size($input-font-size-sm);
153
+ @include border-radius($input-border-radius-sm);
154
+
155
+ &::file-selector-button {
156
+ padding: $input-padding-y-sm $input-padding-x-sm;
157
+ margin: (-$input-padding-y-sm) (-$input-padding-x-sm);
158
+ margin-inline-end: $input-padding-x-sm;
159
+ }
160
+ }
161
+
162
+ .form-control-lg {
163
+ min-height: $input-height-lg;
164
+ padding: $input-padding-y-lg $input-padding-x-lg;
165
+ @include font-size($input-font-size-lg);
166
+ @include border-radius($input-border-radius-lg);
167
+
168
+ &::file-selector-button {
169
+ padding: $input-padding-y-lg $input-padding-x-lg;
170
+ margin: (-$input-padding-y-lg) (-$input-padding-x-lg);
171
+ margin-inline-end: $input-padding-x-lg;
172
+ }
173
+ }
174
+
175
+ // Make sure textareas don't shrink too much when resized
176
+ // https://github.com/twbs/bootstrap/pull/29124
177
+ // stylelint-disable selector-no-qualifying-type
178
+ textarea {
179
+ &.form-control {
180
+ min-height: $input-height;
181
+ }
182
+
183
+ &.form-control-sm {
184
+ min-height: $input-height-sm;
185
+ }
186
+
187
+ &.form-control-lg {
188
+ min-height: $input-height-lg;
189
+ }
190
+ }
191
+ // stylelint-enable selector-no-qualifying-type
192
+
193
+ .form-control-color {
194
+ width: $form-color-width;
195
+ height: $input-height;
196
+ padding: $input-padding-y;
197
+
198
+ &:not(:disabled):not([readonly]) {
199
+ cursor: pointer;
200
+ }
201
+
202
+ &::-moz-color-swatch {
203
+ border: 0 !important; // stylelint-disable-line declaration-no-important
204
+ @include border-radius($input-border-radius);
205
+ }
206
+
207
+ &::-webkit-color-swatch {
208
+ border: 0 !important; // stylelint-disable-line declaration-no-important
209
+ @include border-radius($input-border-radius);
210
+ }
211
+
212
+ &.form-control-sm { height: $input-height-sm; }
213
+ &.form-control-lg { height: $input-height-lg; }
214
+ }
@@ -0,0 +1,91 @@
1
+ // Range
2
+ //
3
+ // Style range inputs the same across browsers. Vendor-specific rules for pseudo
4
+ // elements cannot be mixed. As such, there are no shared styles for focus or
5
+ // active states on prefixed selectors.
6
+
7
+ .form-range {
8
+ width: 100%;
9
+ height: add($form-range-thumb-height, $form-range-thumb-focus-box-shadow-width * 2);
10
+ padding: 0; // Need to reset padding
11
+ appearance: none;
12
+ background-color: transparent;
13
+
14
+ &:focus {
15
+ outline: 0;
16
+
17
+ // Pseudo-elements must be split across multiple rulesets to have an effect.
18
+ // No box-shadow() mixin for focus accessibility.
19
+ &::-webkit-slider-thumb { box-shadow: $form-range-thumb-focus-box-shadow; }
20
+ &::-moz-range-thumb { box-shadow: $form-range-thumb-focus-box-shadow; }
21
+ }
22
+
23
+ &::-moz-focus-outer {
24
+ border: 0;
25
+ }
26
+
27
+ &::-webkit-slider-thumb {
28
+ width: $form-range-thumb-width;
29
+ height: $form-range-thumb-height;
30
+ margin-top: ($form-range-track-height - $form-range-thumb-height) * .5; // Webkit specific
31
+ appearance: none;
32
+ @include gradient-bg($form-range-thumb-bg);
33
+ border: $form-range-thumb-border;
34
+ @include border-radius($form-range-thumb-border-radius);
35
+ @include box-shadow($form-range-thumb-box-shadow);
36
+ @include transition($form-range-thumb-transition);
37
+
38
+ &:active {
39
+ @include gradient-bg($form-range-thumb-active-bg);
40
+ }
41
+ }
42
+
43
+ &::-webkit-slider-runnable-track {
44
+ width: $form-range-track-width;
45
+ height: $form-range-track-height;
46
+ color: transparent; // Why?
47
+ cursor: $form-range-track-cursor;
48
+ background-color: $form-range-track-bg;
49
+ border-color: transparent;
50
+ @include border-radius($form-range-track-border-radius);
51
+ @include box-shadow($form-range-track-box-shadow);
52
+ }
53
+
54
+ &::-moz-range-thumb {
55
+ width: $form-range-thumb-width;
56
+ height: $form-range-thumb-height;
57
+ appearance: none;
58
+ @include gradient-bg($form-range-thumb-bg);
59
+ border: $form-range-thumb-border;
60
+ @include border-radius($form-range-thumb-border-radius);
61
+ @include box-shadow($form-range-thumb-box-shadow);
62
+ @include transition($form-range-thumb-transition);
63
+
64
+ &:active {
65
+ @include gradient-bg($form-range-thumb-active-bg);
66
+ }
67
+ }
68
+
69
+ &::-moz-range-track {
70
+ width: $form-range-track-width;
71
+ height: $form-range-track-height;
72
+ color: transparent;
73
+ cursor: $form-range-track-cursor;
74
+ background-color: $form-range-track-bg;
75
+ border-color: transparent; // Firefox specific?
76
+ @include border-radius($form-range-track-border-radius);
77
+ @include box-shadow($form-range-track-box-shadow);
78
+ }
79
+
80
+ &:disabled {
81
+ pointer-events: none;
82
+
83
+ &::-webkit-slider-thumb {
84
+ background-color: $form-range-thumb-disabled-bg;
85
+ }
86
+
87
+ &::-moz-range-thumb {
88
+ background-color: $form-range-thumb-disabled-bg;
89
+ }
90
+ }
91
+ }
@@ -0,0 +1,80 @@
1
+ // Select
2
+ //
3
+ // Replaces the browser default select with a custom one, mostly pulled from
4
+ // https://primer.github.io/.
5
+
6
+ .form-select {
7
+ --#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator)};
8
+
9
+ display: block;
10
+ width: 100%;
11
+ padding: $form-select-padding-y $form-select-indicator-padding $form-select-padding-y $form-select-padding-x;
12
+ font-family: $form-select-font-family;
13
+ @include font-size($form-select-font-size);
14
+ font-weight: $form-select-font-weight;
15
+ line-height: $form-select-line-height;
16
+ color: $form-select-color;
17
+ appearance: none;
18
+ background-color: $form-select-bg;
19
+ background-image: var(--#{$prefix}form-select-bg-img), var(--#{$prefix}form-select-bg-icon, none);
20
+ background-repeat: no-repeat;
21
+ background-position: $form-select-bg-position;
22
+ background-size: $form-select-bg-size;
23
+ border: $form-select-border-width solid $form-select-border-color;
24
+ @include border-radius($form-select-border-radius, 0);
25
+ @include box-shadow($form-select-box-shadow);
26
+ @include transition($form-select-transition);
27
+
28
+ &:focus {
29
+ border-color: $form-select-focus-border-color;
30
+ outline: 0;
31
+ @if $enable-shadows {
32
+ @include box-shadow($form-select-box-shadow, $form-select-focus-box-shadow);
33
+ } @else {
34
+ // Avoid using mixin so we can pass custom focus shadow properly
35
+ box-shadow: $form-select-focus-box-shadow;
36
+ }
37
+ }
38
+
39
+ &[multiple],
40
+ &[size]:not([size="1"]) {
41
+ padding-right: $form-select-padding-x;
42
+ background-image: none;
43
+ }
44
+
45
+ &:disabled {
46
+ color: $form-select-disabled-color;
47
+ background-color: $form-select-disabled-bg;
48
+ border-color: $form-select-disabled-border-color;
49
+ }
50
+
51
+ // Remove outline from select box in FF
52
+ &:-moz-focusring {
53
+ color: transparent;
54
+ text-shadow: 0 0 0 $form-select-color;
55
+ }
56
+ }
57
+
58
+ .form-select-sm {
59
+ padding-top: $form-select-padding-y-sm;
60
+ padding-bottom: $form-select-padding-y-sm;
61
+ padding-left: $form-select-padding-x-sm;
62
+ @include font-size($form-select-font-size-sm);
63
+ @include border-radius($form-select-border-radius-sm);
64
+ }
65
+
66
+ .form-select-lg {
67
+ padding-top: $form-select-padding-y-lg;
68
+ padding-bottom: $form-select-padding-y-lg;
69
+ padding-left: $form-select-padding-x-lg;
70
+ @include font-size($form-select-font-size-lg);
71
+ @include border-radius($form-select-border-radius-lg);
72
+ }
73
+
74
+ @if $enable-dark-mode {
75
+ @include color-mode(dark) {
76
+ .form-select {
77
+ --#{$prefix}form-select-bg-img: #{escape-svg($form-select-indicator-dark)};
78
+ }
79
+ }
80
+ }
@@ -0,0 +1,11 @@
1
+ //
2
+ // Form text
3
+ //
4
+
5
+ .form-text {
6
+ margin-top: $form-text-margin-top;
7
+ @include font-size($form-text-font-size);
8
+ font-style: $form-text-font-style;
9
+ font-weight: $form-text-font-weight;
10
+ color: $form-text-color;
11
+ }