bootstrap 4.6.0 → 5.0.0.beta2

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 (145) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/README.md +7 -4
  4. data/assets/javascripts/bootstrap-global-this-define.js +6 -0
  5. data/assets/javascripts/bootstrap-global-this-undefine.js +2 -0
  6. data/assets/javascripts/bootstrap-sprockets.js +14 -8
  7. data/assets/javascripts/bootstrap.js +2152 -1633
  8. data/assets/javascripts/bootstrap.min.js +2 -2
  9. data/assets/javascripts/bootstrap/alert.js +179 -64
  10. data/assets/javascripts/bootstrap/base-component.js +75 -0
  11. data/assets/javascripts/bootstrap/button.js +94 -143
  12. data/assets/javascripts/bootstrap/carousel.js +386 -202
  13. data/assets/javascripts/bootstrap/collapse.js +349 -132
  14. data/assets/javascripts/bootstrap/dom/data.js +81 -0
  15. data/assets/javascripts/bootstrap/dom/event-handler.js +310 -0
  16. data/assets/javascripts/bootstrap/dom/manipulator.js +86 -0
  17. data/assets/javascripts/bootstrap/dom/selector-engine.js +93 -0
  18. data/assets/javascripts/bootstrap/dropdown.js +387 -224
  19. data/assets/javascripts/bootstrap/modal.js +391 -220
  20. data/assets/javascripts/bootstrap/popover.js +94 -49
  21. data/assets/javascripts/bootstrap/scrollspy.js +212 -80
  22. data/assets/javascripts/bootstrap/tab.js +198 -79
  23. data/assets/javascripts/bootstrap/toast.js +211 -78
  24. data/assets/javascripts/bootstrap/tooltip.js +558 -300
  25. data/assets/stylesheets/_bootstrap-grid.scss +51 -16
  26. data/assets/stylesheets/_bootstrap-reboot.scss +4 -1
  27. data/assets/stylesheets/_bootstrap.scss +15 -8
  28. data/assets/stylesheets/bootstrap/_accordion.scss +126 -0
  29. data/assets/stylesheets/bootstrap/_alert.scss +15 -10
  30. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  31. data/assets/stylesheets/bootstrap/_breadcrumb.scss +3 -17
  32. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  33. data/assets/stylesheets/bootstrap/_buttons.scss +27 -60
  34. data/assets/stylesheets/bootstrap/_card.scss +21 -92
  35. data/assets/stylesheets/bootstrap/_carousel.scss +65 -33
  36. data/assets/stylesheets/bootstrap/_close.scss +30 -30
  37. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  38. data/assets/stylesheets/bootstrap/_dropdown.scss +95 -38
  39. data/assets/stylesheets/bootstrap/_forms.scss +9 -347
  40. data/assets/stylesheets/bootstrap/_functions.scss +84 -23
  41. data/assets/stylesheets/bootstrap/_grid.scss +3 -54
  42. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  43. data/assets/stylesheets/bootstrap/_list-group.scss +17 -8
  44. data/assets/stylesheets/bootstrap/_mixins.scss +7 -13
  45. data/assets/stylesheets/bootstrap/_modal.scss +41 -46
  46. data/assets/stylesheets/bootstrap/_nav.scss +16 -4
  47. data/assets/stylesheets/bootstrap/_navbar.scss +43 -71
  48. data/assets/stylesheets/bootstrap/_pagination.scss +10 -20
  49. data/assets/stylesheets/bootstrap/_popover.scss +15 -27
  50. data/assets/stylesheets/bootstrap/_progress.scss +2 -4
  51. data/assets/stylesheets/bootstrap/_reboot.scss +314 -163
  52. data/assets/stylesheets/bootstrap/_root.scss +5 -8
  53. data/assets/stylesheets/bootstrap/_spinners.scss +5 -5
  54. data/assets/stylesheets/bootstrap/_tables.scss +79 -114
  55. data/assets/stylesheets/bootstrap/_toasts.scss +20 -15
  56. data/assets/stylesheets/bootstrap/_tooltip.scss +17 -17
  57. data/assets/stylesheets/bootstrap/_transitions.scss +0 -1
  58. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  59. data/assets/stylesheets/bootstrap/_utilities.scss +566 -18
  60. data/assets/stylesheets/bootstrap/_variables.scss +673 -463
  61. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  62. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  63. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  64. data/assets/stylesheets/bootstrap/forms/_form-control.scss +223 -0
  65. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  67. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  68. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  69. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  70. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  71. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  72. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  73. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  74. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  75. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  76. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  77. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  78. data/assets/stylesheets/bootstrap/mixins/_alert.scss +1 -5
  79. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +8 -8
  80. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  81. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  82. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +65 -47
  83. data/assets/stylesheets/bootstrap/mixins/_caret.scss +8 -8
  84. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  85. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  86. data/assets/stylesheets/bootstrap/mixins/_forms.scss +27 -88
  87. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  88. data/assets/stylesheets/bootstrap/mixins/_grid.scss +83 -32
  89. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  90. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +3 -2
  91. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  92. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +15 -8
  93. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  94. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  95. data/assets/stylesheets/bootstrap/mixins/_transition.scss +1 -1
  96. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  97. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  98. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  99. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +234 -126
  100. data/bootstrap.gemspec +1 -3
  101. data/lib/bootstrap/version.rb +2 -2
  102. data/tasks/updater/js.rb +20 -5
  103. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  104. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  105. data/test/dummy_rails/app/views/pages/root.html +89 -0
  106. data/test/dummy_rails/config/application.rb +0 -3
  107. data/test/gemfiles/rails_6_1.gemfile +7 -0
  108. metadata +44 -75
  109. data/assets/javascripts/bootstrap/util.js +0 -192
  110. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  111. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -526
  112. data/assets/stylesheets/bootstrap/_input-group.scss +0 -208
  113. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  114. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  115. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  116. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -23
  117. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  118. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  119. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -80
  120. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  121. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  122. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  123. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  124. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  125. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  126. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  127. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  128. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  129. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  130. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  131. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  132. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  133. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  134. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  135. data/assets/stylesheets/bootstrap/utilities/_interactions.scss +0 -5
  136. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  137. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  138. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  139. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  140. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  141. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  142. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  143. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  144. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  145. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
@@ -1,40 +1,40 @@
1
- .close {
2
- float: right;
3
- @include font-size($close-font-size);
4
- font-weight: $close-font-weight;
5
- line-height: 1;
6
- color: $close-color;
7
- text-shadow: $close-text-shadow;
8
- opacity: .5;
1
+ // transparent background and border properties included for button version.
2
+ // iOS requires the button element instead of an anchor tag.
3
+ // If you want the anchor version, it requires `href="#"`.
4
+ // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
5
+
6
+ .btn-close {
7
+ box-sizing: content-box;
8
+ width: $btn-close-width;
9
+ height: $btn-close-height;
10
+ padding: $btn-close-padding-y $btn-close-padding-x;
11
+ color: $btn-close-color;
12
+ background: transparent escape-svg($btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements
13
+ border: 0; // for button elements
14
+ @include border-radius();
15
+ opacity: $btn-close-opacity;
9
16
 
10
17
  // Override <a>'s hover style
11
- @include hover() {
12
- color: $close-color;
18
+ &:hover {
19
+ color: $btn-close-color;
13
20
  text-decoration: none;
21
+ opacity: $btn-close-hover-opacity;
14
22
  }
15
23
 
16
- &:not(:disabled):not(.disabled) {
17
- @include hover-focus() {
18
- opacity: .75;
19
- }
24
+ &:focus {
25
+ outline: 0;
26
+ box-shadow: $btn-close-focus-shadow;
27
+ opacity: $btn-close-focus-opacity;
20
28
  }
21
- }
22
29
 
23
- // Additional properties for button version
24
- // iOS requires the button element instead of an anchor tag.
25
- // If you want the anchor version, it requires `href="#"`.
26
- // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile
27
-
28
- // stylelint-disable-next-line selector-no-qualifying-type
29
- button.close {
30
- padding: 0;
31
- background-color: transparent;
32
- border: 0;
30
+ &:disabled,
31
+ &.disabled {
32
+ pointer-events: none;
33
+ user-select: none;
34
+ opacity: $btn-close-disabled-opacity;
35
+ }
33
36
  }
34
37
 
35
- // Future-proof disabling of clicks on `<a>` elements
36
-
37
- // stylelint-disable-next-line selector-no-qualifying-type
38
- a.close.disabled {
39
- pointer-events: none;
38
+ .btn-close-white {
39
+ filter: $btn-close-white-filter;
40
40
  }
@@ -0,0 +1,41 @@
1
+ // Container widths
2
+ //
3
+ // Set the container width, and override it for fixed navbars in media queries.
4
+
5
+ @if $enable-grid-classes {
6
+ // Single container class with breakpoint max-widths
7
+ .container,
8
+ // 100% wide container at all breakpoints
9
+ .container-fluid {
10
+ @include make-container();
11
+ }
12
+
13
+ // Responsive containers that are 100% wide until a breakpoint
14
+ @each $breakpoint, $container-max-width in $container-max-widths {
15
+ .container-#{$breakpoint} {
16
+ @extend .container-fluid;
17
+ }
18
+
19
+ @include media-breakpoint-up($breakpoint, $grid-breakpoints) {
20
+ %responsive-container-#{$breakpoint} {
21
+ max-width: $container-max-width;
22
+ }
23
+
24
+ // Extend each breakpoint which is smaller or equal to the current breakpoint
25
+ $extend-breakpoint: true;
26
+
27
+ @each $name, $width in $grid-breakpoints {
28
+ @if ($extend-breakpoint) {
29
+ .container#{breakpoint-infix($name, $grid-breakpoints)} {
30
+ @extend %responsive-container-#{$breakpoint};
31
+ }
32
+
33
+ // Once the current breakpoint is reached, stop extending
34
+ @if ($breakpoint == $name) {
35
+ $extend-breakpoint: false;
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
@@ -1,8 +1,8 @@
1
1
  // The dropdown wrapper (`<div>`)
2
2
  .dropup,
3
- .dropright,
3
+ .dropend,
4
4
  .dropdown,
5
- .dropleft {
5
+ .dropstart {
6
6
  position: relative;
7
7
  }
8
8
 
@@ -17,13 +17,11 @@
17
17
  .dropdown-menu {
18
18
  position: absolute;
19
19
  top: 100%;
20
- left: 0;
21
20
  z-index: $zindex-dropdown;
22
21
  display: none; // none by default, but block on "open" of the menu
23
- float: left;
24
22
  min-width: $dropdown-min-width;
25
23
  padding: $dropdown-padding-y $dropdown-padding-x;
26
- margin: $dropdown-spacer 0 0; // override default ul
24
+ margin: 0; // Override default margin of ul
27
25
  @include font-size($dropdown-font-size);
28
26
  color: $dropdown-color;
29
27
  text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
@@ -33,23 +31,41 @@
33
31
  border: $dropdown-border-width solid $dropdown-border-color;
34
32
  @include border-radius($dropdown-border-radius);
35
33
  @include box-shadow($dropdown-box-shadow);
34
+
35
+ &[data-bs-popper] {
36
+ left: 0;
37
+ margin-top: $dropdown-spacer;
38
+ }
36
39
  }
37
40
 
41
+ // scss-docs-start responsive-breakpoints
42
+ // We deliberately hardcode the `bs-` prefix because we check
43
+ // this custom property in JS to determine Popper's positioning
44
+
38
45
  @each $breakpoint in map-keys($grid-breakpoints) {
39
46
  @include media-breakpoint-up($breakpoint) {
40
47
  $infix: breakpoint-infix($breakpoint, $grid-breakpoints);
41
48
 
42
- .dropdown-menu#{$infix}-left {
43
- right: auto;
44
- left: 0;
49
+ .dropdown-menu#{$infix}-start {
50
+ --bs-position: start;
51
+
52
+ &[data-bs-popper] {
53
+ right: auto #{"/* rtl:ignore */"};
54
+ left: 0 #{"/* rtl:ignore */"};
55
+ }
45
56
  }
46
57
 
47
- .dropdown-menu#{$infix}-right {
48
- right: 0;
49
- left: auto;
58
+ .dropdown-menu#{$infix}-end {
59
+ --bs-position: end;
60
+
61
+ &[data-bs-popper] {
62
+ right: 0 #{"/* rtl:ignore */"};
63
+ left: auto #{"/* rtl:ignore */"};
64
+ }
50
65
  }
51
66
  }
52
67
  }
68
+ // scss-docs-end responsive-breakpoints
53
69
 
54
70
  // Allow for dropdowns to go bottom up (aka, dropup-menu)
55
71
  // Just add .dropup after the standard .dropdown class and you're set.
@@ -57,8 +73,11 @@
57
73
  .dropdown-menu {
58
74
  top: auto;
59
75
  bottom: 100%;
60
- margin-top: 0;
61
- margin-bottom: $dropdown-spacer;
76
+
77
+ &[data-bs-popper] {
78
+ margin-top: 0;
79
+ margin-bottom: $dropdown-spacer;
80
+ }
62
81
  }
63
82
 
64
83
  .dropdown-toggle {
@@ -66,55 +85,53 @@
66
85
  }
67
86
  }
68
87
 
69
- .dropright {
88
+ .dropend {
70
89
  .dropdown-menu {
71
90
  top: 0;
72
91
  right: auto;
73
92
  left: 100%;
74
- margin-top: 0;
75
- margin-left: $dropdown-spacer;
93
+
94
+ &[data-bs-popper] {
95
+ margin-top: 0;
96
+ margin-left: $dropdown-spacer;
97
+ }
76
98
  }
77
99
 
78
100
  .dropdown-toggle {
79
- @include caret(right);
101
+ @include caret(end);
80
102
  &::after {
81
103
  vertical-align: 0;
82
104
  }
83
105
  }
84
106
  }
85
107
 
86
- .dropleft {
108
+ .dropstart {
87
109
  .dropdown-menu {
88
110
  top: 0;
89
111
  right: 100%;
90
112
  left: auto;
91
- margin-top: 0;
92
- margin-right: $dropdown-spacer;
113
+
114
+ &[data-bs-popper] {
115
+ margin-top: 0;
116
+ margin-right: $dropdown-spacer;
117
+ }
93
118
  }
94
119
 
95
120
  .dropdown-toggle {
96
- @include caret(left);
121
+ @include caret(start);
97
122
  &::before {
98
123
  vertical-align: 0;
99
124
  }
100
125
  }
101
126
  }
102
127
 
103
- // When Popper is enabled, reset the basic dropdown position
104
- // stylelint-disable-next-line no-duplicate-selectors
105
- .dropdown-menu {
106
- &[x-placement^="top"],
107
- &[x-placement^="right"],
108
- &[x-placement^="bottom"],
109
- &[x-placement^="left"] {
110
- right: auto;
111
- bottom: auto;
112
- }
113
- }
114
128
 
115
129
  // Dividers (basically an `<hr>`) within the dropdown
116
130
  .dropdown-divider {
117
- @include nav-divider($dropdown-divider-bg, $dropdown-divider-margin-y, true);
131
+ height: 0;
132
+ margin: $dropdown-divider-margin-y 0;
133
+ overflow: hidden;
134
+ border-top: 1px solid $dropdown-divider-bg;
118
135
  }
119
136
 
120
137
  // Links, buttons, and more within the dropdown menu
@@ -145,9 +162,10 @@
145
162
  }
146
163
  }
147
164
 
148
- @include hover-focus() {
165
+ &:hover,
166
+ &:focus {
149
167
  color: $dropdown-link-hover-color;
150
- text-decoration: none;
168
+ text-decoration: if($link-hover-decoration == underline, none, null);
151
169
  @include gradient-bg($dropdown-link-hover-bg);
152
170
  }
153
171
 
@@ -164,9 +182,7 @@
164
182
  pointer-events: none;
165
183
  background-color: transparent;
166
184
  // Remove CSS gradients if they're enabled
167
- @if $enable-gradients {
168
- background-image: none;
169
- }
185
+ background-image: if($enable-gradients, none, null);
170
186
  }
171
187
  }
172
188
 
@@ -190,3 +206,44 @@
190
206
  padding: $dropdown-item-padding-y $dropdown-item-padding-x;
191
207
  color: $dropdown-link-color;
192
208
  }
209
+
210
+ // Dark dropdowns
211
+ .dropdown-menu-dark {
212
+ color: $dropdown-dark-color;
213
+ background-color: $dropdown-dark-bg;
214
+ border-color: $dropdown-dark-border-color;
215
+ @include box-shadow($dropdown-dark-box-shadow);
216
+
217
+ .dropdown-item {
218
+ color: $dropdown-dark-link-color;
219
+
220
+ &:hover,
221
+ &:focus {
222
+ color: $dropdown-dark-link-hover-color;
223
+ @include gradient-bg($dropdown-dark-link-hover-bg);
224
+ }
225
+
226
+ &.active,
227
+ &:active {
228
+ color: $dropdown-dark-link-active-color;
229
+ @include gradient-bg($dropdown-dark-link-active-bg);
230
+ }
231
+
232
+ &.disabled,
233
+ &:disabled {
234
+ color: $dropdown-dark-link-disabled-color;
235
+ }
236
+ }
237
+
238
+ .dropdown-divider {
239
+ border-color: $dropdown-dark-divider-bg;
240
+ }
241
+
242
+ .dropdown-item-text {
243
+ color: $dropdown-dark-link-color;
244
+ }
245
+
246
+ .dropdown-header {
247
+ color: $dropdown-dark-header-color;
248
+ }
249
+ }
@@ -1,347 +1,9 @@
1
- // stylelint-disable selector-no-qualifying-type
2
-
3
- //
4
- // Textual form controls
5
- //
6
-
7
- .form-control {
8
- display: block;
9
- width: 100%;
10
- height: $input-height;
11
- padding: $input-padding-y $input-padding-x;
12
- font-family: $input-font-family;
13
- @include font-size($input-font-size);
14
- font-weight: $input-font-weight;
15
- line-height: $input-line-height;
16
- color: $input-color;
17
- background-color: $input-bg;
18
- background-clip: padding-box;
19
- border: $input-border-width solid $input-border-color;
20
-
21
- // Note: This has no effect on <select>s in some browsers, due to the limited stylability of `<select>`s in CSS.
22
- @include border-radius($input-border-radius, 0);
23
-
24
- @include box-shadow($input-box-shadow);
25
- @include transition($input-transition);
26
-
27
- // Unstyle the caret on `<select>`s in IE10+.
28
- &::-ms-expand {
29
- background-color: transparent;
30
- border: 0;
31
- }
32
-
33
- // Remove select outline from select box in FF
34
- &:-moz-focusring {
35
- color: transparent;
36
- text-shadow: 0 0 0 $input-color;
37
- }
38
-
39
- // Customize the `:focus` state to imitate native WebKit styles.
40
- @include form-control-focus($ignore-warning: true);
41
-
42
- // Placeholder
43
- &::placeholder {
44
- color: $input-placeholder-color;
45
- // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526.
46
- opacity: 1;
47
- }
48
-
49
- // Disabled and read-only inputs
50
- //
51
- // HTML5 says that controls under a fieldset > legend:first-child won't be
52
- // disabled if the fieldset is disabled. Due to implementation difficulty, we
53
- // don't honor that edge case; we style them as disabled anyway.
54
- &:disabled,
55
- &[readonly] {
56
- background-color: $input-disabled-bg;
57
- // iOS fix for unreadable disabled content; see https://github.com/twbs/bootstrap/issues/11655.
58
- opacity: 1;
59
- }
60
- }
61
-
62
- input[type="date"],
63
- input[type="time"],
64
- input[type="datetime-local"],
65
- input[type="month"] {
66
- &.form-control {
67
- appearance: none; // Fix appearance for date inputs in Safari
68
- }
69
- }
70
-
71
- select.form-control {
72
- &:focus::-ms-value {
73
- // Suppress the nested default white text on blue background highlight given to
74
- // the selected option text when the (still closed) <select> receives focus
75
- // in IE and (under certain conditions) Edge, as it looks bad and cannot be made to
76
- // match the appearance of the native widget.
77
- // See https://github.com/twbs/bootstrap/issues/19398.
78
- color: $input-color;
79
- background-color: $input-bg;
80
- }
81
- }
82
-
83
- // Make file inputs better match text inputs by forcing them to new lines.
84
- .form-control-file,
85
- .form-control-range {
86
- display: block;
87
- width: 100%;
88
- }
89
-
90
-
91
- //
92
- // Labels
93
- //
94
-
95
- // For use with horizontal and inline forms, when you need the label (or legend)
96
- // text to align with the form controls.
97
- .col-form-label {
98
- padding-top: add($input-padding-y, $input-border-width);
99
- padding-bottom: add($input-padding-y, $input-border-width);
100
- margin-bottom: 0; // Override the `<label>/<legend>` default
101
- @include font-size(inherit); // Override the `<legend>` default
102
- line-height: $input-line-height;
103
- }
104
-
105
- .col-form-label-lg {
106
- padding-top: add($input-padding-y-lg, $input-border-width);
107
- padding-bottom: add($input-padding-y-lg, $input-border-width);
108
- @include font-size($input-font-size-lg);
109
- line-height: $input-line-height-lg;
110
- }
111
-
112
- .col-form-label-sm {
113
- padding-top: add($input-padding-y-sm, $input-border-width);
114
- padding-bottom: add($input-padding-y-sm, $input-border-width);
115
- @include font-size($input-font-size-sm);
116
- line-height: $input-line-height-sm;
117
- }
118
-
119
-
120
- // Readonly controls as plain text
121
- //
122
- // Apply class to a readonly input to make it appear like regular plain
123
- // text (without any border, background color, focus indicator)
124
-
125
- .form-control-plaintext {
126
- display: block;
127
- width: 100%;
128
- padding: $input-padding-y 0;
129
- margin-bottom: 0; // match inputs if this class comes on inputs with default margins
130
- @include font-size($input-font-size);
131
- line-height: $input-line-height;
132
- color: $input-plaintext-color;
133
- background-color: transparent;
134
- border: solid transparent;
135
- border-width: $input-border-width 0;
136
-
137
- &.form-control-sm,
138
- &.form-control-lg {
139
- padding-right: 0;
140
- padding-left: 0;
141
- }
142
- }
143
-
144
-
145
- // Form control sizing
146
- //
147
- // Build on `.form-control` with modifier classes to decrease or increase the
148
- // height and font-size of form controls.
149
- //
150
- // Repeated in `_input_group.scss` to avoid Sass extend issues.
151
-
152
- .form-control-sm {
153
- height: $input-height-sm;
154
- padding: $input-padding-y-sm $input-padding-x-sm;
155
- @include font-size($input-font-size-sm);
156
- line-height: $input-line-height-sm;
157
- @include border-radius($input-border-radius-sm);
158
- }
159
-
160
- .form-control-lg {
161
- height: $input-height-lg;
162
- padding: $input-padding-y-lg $input-padding-x-lg;
163
- @include font-size($input-font-size-lg);
164
- line-height: $input-line-height-lg;
165
- @include border-radius($input-border-radius-lg);
166
- }
167
-
168
- // stylelint-disable-next-line no-duplicate-selectors
169
- select.form-control {
170
- &[size],
171
- &[multiple] {
172
- height: auto;
173
- }
174
- }
175
-
176
- textarea.form-control {
177
- height: auto;
178
- }
179
-
180
- // Form groups
181
- //
182
- // Designed to help with the organization and spacing of vertical forms. For
183
- // horizontal forms, use the predefined grid classes.
184
-
185
- .form-group {
186
- margin-bottom: $form-group-margin-bottom;
187
- }
188
-
189
- .form-text {
190
- display: block;
191
- margin-top: $form-text-margin-top;
192
- }
193
-
194
-
195
- // Form grid
196
- //
197
- // Special replacement for our grid system's `.row` for tighter form layouts.
198
-
199
- .form-row {
200
- display: flex;
201
- flex-wrap: wrap;
202
- margin-right: -$form-grid-gutter-width / 2;
203
- margin-left: -$form-grid-gutter-width / 2;
204
-
205
- > .col,
206
- > [class*="col-"] {
207
- padding-right: $form-grid-gutter-width / 2;
208
- padding-left: $form-grid-gutter-width / 2;
209
- }
210
- }
211
-
212
-
213
- // Checkboxes and radios
214
- //
215
- // Indent the labels to position radios/checkboxes as hanging controls.
216
-
217
- .form-check {
218
- position: relative;
219
- display: block;
220
- padding-left: $form-check-input-gutter;
221
- }
222
-
223
- .form-check-input {
224
- position: absolute;
225
- margin-top: $form-check-input-margin-y;
226
- margin-left: -$form-check-input-gutter;
227
-
228
- // Use [disabled] and :disabled for workaround https://github.com/twbs/bootstrap/issues/28247
229
- &[disabled] ~ .form-check-label,
230
- &:disabled ~ .form-check-label {
231
- color: $text-muted;
232
- }
233
- }
234
-
235
- .form-check-label {
236
- margin-bottom: 0; // Override default `<label>` bottom margin
237
- }
238
-
239
- .form-check-inline {
240
- display: inline-flex;
241
- align-items: center;
242
- padding-left: 0; // Override base .form-check
243
- margin-right: $form-check-inline-margin-x;
244
-
245
- // Undo .form-check-input defaults and add some `margin-right`.
246
- .form-check-input {
247
- position: static;
248
- margin-top: 0;
249
- margin-right: $form-check-inline-input-margin-x;
250
- margin-left: 0;
251
- }
252
- }
253
-
254
-
255
- // Form validation
256
- //
257
- // Provide feedback to users when form field values are valid or invalid. Works
258
- // primarily for client-side validation via scoped `:invalid` and `:valid`
259
- // pseudo-classes but also includes `.is-invalid` and `.is-valid` classes for
260
- // server side validation.
261
-
262
- @each $state, $data in $form-validation-states {
263
- @include form-validation-state($state, map-get($data, color), map-get($data, icon));
264
- }
265
-
266
- // Inline forms
267
- //
268
- // Make forms appear inline(-block) by adding the `.form-inline` class. Inline
269
- // forms begin stacked on extra small (mobile) devices and then go inline when
270
- // viewports reach <768px.
271
- //
272
- // Requires wrapping inputs and labels with `.form-group` for proper display of
273
- // default HTML form controls and our custom form controls (e.g., input groups).
274
-
275
- .form-inline {
276
- display: flex;
277
- flex-flow: row wrap;
278
- align-items: center; // Prevent shorter elements from growing to same height as others (e.g., small buttons growing to normal sized button height)
279
-
280
- // Because we use flex, the initial sizing of checkboxes is collapsed and
281
- // doesn't occupy the full-width (which is what we want for xs grid tier),
282
- // so we force that here.
283
- .form-check {
284
- width: 100%;
285
- }
286
-
287
- // Kick in the inline
288
- @include media-breakpoint-up(sm) {
289
- label {
290
- display: flex;
291
- align-items: center;
292
- justify-content: center;
293
- margin-bottom: 0;
294
- }
295
-
296
- // Inline-block all the things for "inline"
297
- .form-group {
298
- display: flex;
299
- flex: 0 0 auto;
300
- flex-flow: row wrap;
301
- align-items: center;
302
- margin-bottom: 0;
303
- }
304
-
305
- // Allow folks to *not* use `.form-group`
306
- .form-control {
307
- display: inline-block;
308
- width: auto; // Prevent labels from stacking above inputs in `.form-group`
309
- vertical-align: middle;
310
- }
311
-
312
- // Make static controls behave like regular ones
313
- .form-control-plaintext {
314
- display: inline-block;
315
- }
316
-
317
- .input-group,
318
- .custom-select {
319
- width: auto;
320
- }
321
-
322
- // Remove default margin on radios/checkboxes that were used for stacking, and
323
- // then undo the floating of radios and checkboxes to match.
324
- .form-check {
325
- display: flex;
326
- align-items: center;
327
- justify-content: center;
328
- width: auto;
329
- padding-left: 0;
330
- }
331
- .form-check-input {
332
- position: relative;
333
- flex-shrink: 0;
334
- margin-top: 0;
335
- margin-right: $form-check-input-margin-x;
336
- margin-left: 0;
337
- }
338
-
339
- .custom-control {
340
- align-items: center;
341
- justify-content: center;
342
- }
343
- .custom-control-label {
344
- margin-bottom: 0;
345
- }
346
- }
347
- }
1
+ @import "forms/labels";
2
+ @import "forms/form-text";
3
+ @import "forms/form-control";
4
+ @import "forms/form-select";
5
+ @import "forms/form-check";
6
+ @import "forms/form-range";
7
+ @import "forms/floating-labels";
8
+ @import "forms/input-group";
9
+ @import "forms/validation";