bootstrap 4.4.1 → 5.0.1

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 (149) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +13 -2
  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 +15 -8
  7. data/assets/javascripts/bootstrap.js +3244 -2770
  8. data/assets/javascripts/bootstrap.min.js +4 -4
  9. data/assets/javascripts/bootstrap/alert.js +130 -124
  10. data/assets/javascripts/bootstrap/base-component.js +168 -0
  11. data/assets/javascripts/bootstrap/button.js +85 -179
  12. data/assets/javascripts/bootstrap/carousel.js +430 -405
  13. data/assets/javascripts/bootstrap/collapse.js +325 -264
  14. data/assets/javascripts/bootstrap/dom/data.js +68 -0
  15. data/assets/javascripts/bootstrap/dom/event-handler.js +315 -0
  16. data/assets/javascripts/bootstrap/dom/manipulator.js +88 -0
  17. data/assets/javascripts/bootstrap/dom/selector-engine.js +85 -0
  18. data/assets/javascripts/bootstrap/dropdown.js +464 -400
  19. data/assets/javascripts/bootstrap/modal.js +604 -464
  20. data/assets/javascripts/bootstrap/offcanvas.js +671 -0
  21. data/assets/javascripts/bootstrap/popover.js +119 -192
  22. data/assets/javascripts/bootstrap/scrollspy.js +250 -238
  23. data/assets/javascripts/bootstrap/tab.js +189 -151
  24. data/assets/javascripts/bootstrap/toast.js +215 -192
  25. data/assets/javascripts/bootstrap/tooltip.js +604 -544
  26. data/assets/stylesheets/_bootstrap-grid.scss +54 -18
  27. data/assets/stylesheets/_bootstrap-reboot.scss +7 -4
  28. data/assets/stylesheets/_bootstrap.scss +19 -11
  29. data/assets/stylesheets/bootstrap/_accordion.scss +118 -0
  30. data/assets/stylesheets/bootstrap/_alert.scss +15 -9
  31. data/assets/stylesheets/bootstrap/_badge.scss +2 -27
  32. data/assets/stylesheets/bootstrap/_breadcrumb.scss +4 -18
  33. data/assets/stylesheets/bootstrap/_button-group.scss +21 -45
  34. data/assets/stylesheets/bootstrap/_buttons.scss +27 -55
  35. data/assets/stylesheets/bootstrap/_card.scss +43 -106
  36. data/assets/stylesheets/bootstrap/_carousel.scss +65 -33
  37. data/assets/stylesheets/bootstrap/_close.scss +30 -31
  38. data/assets/stylesheets/bootstrap/_containers.scss +41 -0
  39. data/assets/stylesheets/bootstrap/_dropdown.scss +87 -38
  40. data/assets/stylesheets/bootstrap/_forms.scss +9 -338
  41. data/assets/stylesheets/bootstrap/_functions.scss +99 -28
  42. data/assets/stylesheets/bootstrap/_grid.scss +3 -50
  43. data/assets/stylesheets/bootstrap/_helpers.scss +7 -0
  44. data/assets/stylesheets/bootstrap/_list-group.scss +38 -22
  45. data/assets/stylesheets/bootstrap/_mixins.scss +8 -13
  46. data/assets/stylesheets/bootstrap/_modal.scss +45 -65
  47. data/assets/stylesheets/bootstrap/_nav.scss +28 -9
  48. data/assets/stylesheets/bootstrap/_navbar.scss +51 -69
  49. data/assets/stylesheets/bootstrap/_offcanvas.scss +77 -0
  50. data/assets/stylesheets/bootstrap/_pagination.scss +11 -20
  51. data/assets/stylesheets/bootstrap/_popover.scss +15 -27
  52. data/assets/stylesheets/bootstrap/_progress.scss +6 -4
  53. data/assets/stylesheets/bootstrap/_reboot.scss +339 -200
  54. data/assets/stylesheets/bootstrap/_root.scss +5 -9
  55. data/assets/stylesheets/bootstrap/_spinners.scss +21 -7
  56. data/assets/stylesheets/bootstrap/_tables.scss +80 -114
  57. data/assets/stylesheets/bootstrap/_toasts.scss +21 -14
  58. data/assets/stylesheets/bootstrap/_tooltip.scss +17 -17
  59. data/assets/stylesheets/bootstrap/_transitions.scss +2 -1
  60. data/assets/stylesheets/bootstrap/_type.scss +38 -59
  61. data/assets/stylesheets/bootstrap/_utilities.scss +594 -17
  62. data/assets/stylesheets/bootstrap/_variables.scss +810 -489
  63. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +18 -0
  64. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  65. data/assets/stylesheets/bootstrap/forms/_form-check.scss +152 -0
  66. data/assets/stylesheets/bootstrap/forms/_form-control.scss +219 -0
  67. data/assets/stylesheets/bootstrap/forms/_form-range.scss +91 -0
  68. data/assets/stylesheets/bootstrap/forms/_form-select.scss +67 -0
  69. data/assets/stylesheets/bootstrap/forms/_form-text.scss +11 -0
  70. data/assets/stylesheets/bootstrap/forms/_input-group.scss +121 -0
  71. data/assets/stylesheets/bootstrap/forms/_labels.scss +36 -0
  72. data/assets/stylesheets/bootstrap/forms/_validation.scss +12 -0
  73. data/assets/stylesheets/bootstrap/{utilities → helpers}/_clearfix.scss +0 -0
  74. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +12 -0
  75. data/assets/stylesheets/bootstrap/helpers/_position.scss +30 -0
  76. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +26 -0
  77. data/assets/stylesheets/bootstrap/helpers/_stretched-link.scss +15 -0
  78. data/assets/stylesheets/bootstrap/helpers/_text-truncation.scss +7 -0
  79. data/assets/stylesheets/bootstrap/helpers/_visually-hidden.scss +8 -0
  80. data/assets/stylesheets/bootstrap/mixins/_alert.scss +3 -5
  81. data/assets/stylesheets/bootstrap/mixins/_border-radius.scss +37 -22
  82. data/assets/stylesheets/bootstrap/mixins/_box-shadow.scss +7 -9
  83. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +14 -10
  84. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +75 -52
  85. data/assets/stylesheets/bootstrap/mixins/_caret.scss +10 -8
  86. data/assets/stylesheets/bootstrap/mixins/_clearfix.scss +2 -0
  87. data/assets/stylesheets/bootstrap/mixins/_color-scheme.scss +7 -0
  88. data/assets/stylesheets/bootstrap/mixins/_container.scss +9 -0
  89. data/assets/stylesheets/bootstrap/mixins/_forms.scss +42 -75
  90. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +13 -11
  91. data/assets/stylesheets/bootstrap/mixins/_grid.scss +90 -34
  92. data/assets/stylesheets/bootstrap/mixins/_image.scss +1 -21
  93. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +5 -2
  94. data/assets/stylesheets/bootstrap/mixins/_lists.scss +1 -1
  95. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +17 -8
  96. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +2 -2
  97. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +21 -0
  98. data/assets/stylesheets/bootstrap/mixins/_transition.scss +18 -8
  99. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +68 -0
  100. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +29 -0
  101. data/assets/stylesheets/bootstrap/utilities/_api.scss +47 -0
  102. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +234 -126
  103. data/bootstrap.gemspec +1 -3
  104. data/lib/bootstrap/version.rb +2 -2
  105. data/tasks/updater/js.rb +20 -5
  106. data/tasks/updater/network.rb +8 -2
  107. data/test/dummy_rails/app/assets/javascripts/application.js +4 -3
  108. data/test/dummy_rails/app/views/layouts/application.html.erb +3 -1
  109. data/test/dummy_rails/app/views/pages/root.html +89 -0
  110. data/test/dummy_rails/config/application.rb +0 -3
  111. data/test/gemfiles/rails_6_0.gemfile +7 -0
  112. data/test/gemfiles/rails_6_1.gemfile +7 -0
  113. metadata +48 -73
  114. data/assets/javascripts/bootstrap/util.js +0 -188
  115. data/assets/stylesheets/bootstrap/_code.scss +0 -48
  116. data/assets/stylesheets/bootstrap/_custom-forms.scss +0 -521
  117. data/assets/stylesheets/bootstrap/_input-group.scss +0 -191
  118. data/assets/stylesheets/bootstrap/_jumbotron.scss +0 -17
  119. data/assets/stylesheets/bootstrap/_media.scss +0 -8
  120. data/assets/stylesheets/bootstrap/_print.scss +0 -141
  121. data/assets/stylesheets/bootstrap/mixins/_background-variant.scss +0 -22
  122. data/assets/stylesheets/bootstrap/mixins/_badge.scss +0 -17
  123. data/assets/stylesheets/bootstrap/mixins/_float.scss +0 -14
  124. data/assets/stylesheets/bootstrap/mixins/_grid-framework.scss +0 -71
  125. data/assets/stylesheets/bootstrap/mixins/_hover.scss +0 -37
  126. data/assets/stylesheets/bootstrap/mixins/_nav-divider.scss +0 -11
  127. data/assets/stylesheets/bootstrap/mixins/_screen-reader.scss +0 -34
  128. data/assets/stylesheets/bootstrap/mixins/_size.scss +0 -7
  129. data/assets/stylesheets/bootstrap/mixins/_table-row.scss +0 -39
  130. data/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss +0 -17
  131. data/assets/stylesheets/bootstrap/mixins/_text-hide.scss +0 -11
  132. data/assets/stylesheets/bootstrap/mixins/_visibility.scss +0 -8
  133. data/assets/stylesheets/bootstrap/utilities/_align.scss +0 -8
  134. data/assets/stylesheets/bootstrap/utilities/_background.scss +0 -19
  135. data/assets/stylesheets/bootstrap/utilities/_borders.scss +0 -75
  136. data/assets/stylesheets/bootstrap/utilities/_display.scss +0 -26
  137. data/assets/stylesheets/bootstrap/utilities/_embed.scss +0 -39
  138. data/assets/stylesheets/bootstrap/utilities/_flex.scss +0 -51
  139. data/assets/stylesheets/bootstrap/utilities/_float.scss +0 -11
  140. data/assets/stylesheets/bootstrap/utilities/_overflow.scss +0 -5
  141. data/assets/stylesheets/bootstrap/utilities/_position.scss +0 -32
  142. data/assets/stylesheets/bootstrap/utilities/_screenreaders.scss +0 -11
  143. data/assets/stylesheets/bootstrap/utilities/_shadows.scss +0 -6
  144. data/assets/stylesheets/bootstrap/utilities/_sizing.scss +0 -20
  145. data/assets/stylesheets/bootstrap/utilities/_spacing.scss +0 -73
  146. data/assets/stylesheets/bootstrap/utilities/_stretched-link.scss +0 -19
  147. data/assets/stylesheets/bootstrap/utilities/_text.scss +0 -72
  148. data/assets/stylesheets/bootstrap/utilities/_visibility.scss +0 -13
  149. data/test/dummy_rails/app/views/pages/root.html.slim +0 -58
@@ -1,188 +0,0 @@
1
- /*!
2
- * Bootstrap util.js v4.4.1 (https://getbootstrap.com/)
3
- * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5
- */
6
- (function (global, factory) {
7
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('jquery')) :
8
- typeof define === 'function' && define.amd ? define(['jquery'], factory) :
9
- (global = global || self, global.Util = factory(global.jQuery));
10
- }(this, (function ($) { 'use strict';
11
-
12
- $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
13
-
14
- /**
15
- * --------------------------------------------------------------------------
16
- * Bootstrap (v4.4.1): util.js
17
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
18
- * --------------------------------------------------------------------------
19
- */
20
- /**
21
- * ------------------------------------------------------------------------
22
- * Private TransitionEnd Helpers
23
- * ------------------------------------------------------------------------
24
- */
25
-
26
- var TRANSITION_END = 'transitionend';
27
- var MAX_UID = 1000000;
28
- var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
29
-
30
- function toType(obj) {
31
- return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
32
- }
33
-
34
- function getSpecialTransitionEndEvent() {
35
- return {
36
- bindType: TRANSITION_END,
37
- delegateType: TRANSITION_END,
38
- handle: function handle(event) {
39
- if ($(event.target).is(this)) {
40
- return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
41
- }
42
-
43
- return undefined; // eslint-disable-line no-undefined
44
- }
45
- };
46
- }
47
-
48
- function transitionEndEmulator(duration) {
49
- var _this = this;
50
-
51
- var called = false;
52
- $(this).one(Util.TRANSITION_END, function () {
53
- called = true;
54
- });
55
- setTimeout(function () {
56
- if (!called) {
57
- Util.triggerTransitionEnd(_this);
58
- }
59
- }, duration);
60
- return this;
61
- }
62
-
63
- function setTransitionEndSupport() {
64
- $.fn.emulateTransitionEnd = transitionEndEmulator;
65
- $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
66
- }
67
- /**
68
- * --------------------------------------------------------------------------
69
- * Public Util Api
70
- * --------------------------------------------------------------------------
71
- */
72
-
73
-
74
- var Util = {
75
- TRANSITION_END: 'bsTransitionEnd',
76
- getUID: function getUID(prefix) {
77
- do {
78
- // eslint-disable-next-line no-bitwise
79
- prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
80
- } while (document.getElementById(prefix));
81
-
82
- return prefix;
83
- },
84
- getSelectorFromElement: function getSelectorFromElement(element) {
85
- var selector = element.getAttribute('data-target');
86
-
87
- if (!selector || selector === '#') {
88
- var hrefAttr = element.getAttribute('href');
89
- selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
90
- }
91
-
92
- try {
93
- return document.querySelector(selector) ? selector : null;
94
- } catch (err) {
95
- return null;
96
- }
97
- },
98
- getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
99
- if (!element) {
100
- return 0;
101
- } // Get transition-duration of the element
102
-
103
-
104
- var transitionDuration = $(element).css('transition-duration');
105
- var transitionDelay = $(element).css('transition-delay');
106
- var floatTransitionDuration = parseFloat(transitionDuration);
107
- var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
108
-
109
- if (!floatTransitionDuration && !floatTransitionDelay) {
110
- return 0;
111
- } // If multiple durations are defined, take the first
112
-
113
-
114
- transitionDuration = transitionDuration.split(',')[0];
115
- transitionDelay = transitionDelay.split(',')[0];
116
- return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
117
- },
118
- reflow: function reflow(element) {
119
- return element.offsetHeight;
120
- },
121
- triggerTransitionEnd: function triggerTransitionEnd(element) {
122
- $(element).trigger(TRANSITION_END);
123
- },
124
- // TODO: Remove in v5
125
- supportsTransitionEnd: function supportsTransitionEnd() {
126
- return Boolean(TRANSITION_END);
127
- },
128
- isElement: function isElement(obj) {
129
- return (obj[0] || obj).nodeType;
130
- },
131
- typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
132
- for (var property in configTypes) {
133
- if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
134
- var expectedTypes = configTypes[property];
135
- var value = config[property];
136
- var valueType = value && Util.isElement(value) ? 'element' : toType(value);
137
-
138
- if (!new RegExp(expectedTypes).test(valueType)) {
139
- throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
140
- }
141
- }
142
- }
143
- },
144
- findShadowRoot: function findShadowRoot(element) {
145
- if (!document.documentElement.attachShadow) {
146
- return null;
147
- } // Can find the shadow root otherwise it'll return the document
148
-
149
-
150
- if (typeof element.getRootNode === 'function') {
151
- var root = element.getRootNode();
152
- return root instanceof ShadowRoot ? root : null;
153
- }
154
-
155
- if (element instanceof ShadowRoot) {
156
- return element;
157
- } // when we don't find a shadow root
158
-
159
-
160
- if (!element.parentNode) {
161
- return null;
162
- }
163
-
164
- return Util.findShadowRoot(element.parentNode);
165
- },
166
- jQueryDetection: function jQueryDetection() {
167
- if (typeof $ === 'undefined') {
168
- throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
169
- }
170
-
171
- var version = $.fn.jquery.split(' ')[0].split('.');
172
- var minMajor = 1;
173
- var ltMajor = 2;
174
- var minMinor = 9;
175
- var minPatch = 1;
176
- var maxMajor = 4;
177
-
178
- if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
179
- throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
180
- }
181
- }
182
- };
183
- Util.jQueryDetection();
184
- setTransitionEndSupport();
185
-
186
- return Util;
187
-
188
- })));
@@ -1,48 +0,0 @@
1
- // Inline code
2
- code {
3
- @include font-size($code-font-size);
4
- color: $code-color;
5
- word-wrap: break-word;
6
-
7
- // Streamline the style when inside anchors to avoid broken underline and more
8
- a > & {
9
- color: inherit;
10
- }
11
- }
12
-
13
- // User input typically entered via keyboard
14
- kbd {
15
- padding: $kbd-padding-y $kbd-padding-x;
16
- @include font-size($kbd-font-size);
17
- color: $kbd-color;
18
- background-color: $kbd-bg;
19
- @include border-radius($border-radius-sm);
20
- @include box-shadow($kbd-box-shadow);
21
-
22
- kbd {
23
- padding: 0;
24
- @include font-size(100%);
25
- font-weight: $nested-kbd-font-weight;
26
- @include box-shadow(none);
27
- }
28
- }
29
-
30
- // Blocks of code
31
- pre {
32
- display: block;
33
- @include font-size($code-font-size);
34
- color: $pre-color;
35
-
36
- // Account for some code outputs that place code tags in pre tags
37
- code {
38
- @include font-size(inherit);
39
- color: inherit;
40
- word-break: normal;
41
- }
42
- }
43
-
44
- // Enable scrollable blocks of code
45
- .pre-scrollable {
46
- max-height: $pre-scrollable-max-height;
47
- overflow-y: scroll;
48
- }
@@ -1,521 +0,0 @@
1
- // Embedded icons from Open Iconic.
2
- // Released under MIT and copyright 2014 Waybury.
3
- // https://useiconic.com/open
4
-
5
-
6
- // Checkboxes and radios
7
- //
8
- // Base class takes care of all the key behavioral aspects.
9
-
10
- .custom-control {
11
- position: relative;
12
- display: block;
13
- min-height: $font-size-base * $line-height-base;
14
- padding-left: $custom-control-gutter + $custom-control-indicator-size;
15
- }
16
-
17
- .custom-control-inline {
18
- display: inline-flex;
19
- margin-right: $custom-control-spacer-x;
20
- }
21
-
22
- .custom-control-input {
23
- position: absolute;
24
- left: 0;
25
- z-index: -1; // Put the input behind the label so it doesn't overlay text
26
- width: $custom-control-indicator-size;
27
- height: ($font-size-base * $line-height-base + $custom-control-indicator-size) / 2;
28
- opacity: 0;
29
-
30
- &:checked ~ .custom-control-label::before {
31
- color: $custom-control-indicator-checked-color;
32
- border-color: $custom-control-indicator-checked-border-color;
33
- @include gradient-bg($custom-control-indicator-checked-bg);
34
- @include box-shadow($custom-control-indicator-checked-box-shadow);
35
- }
36
-
37
- &:focus ~ .custom-control-label::before {
38
- // the mixin is not used here to make sure there is feedback
39
- @if $enable-shadows {
40
- box-shadow: $input-box-shadow, $input-focus-box-shadow;
41
- } @else {
42
- box-shadow: $custom-control-indicator-focus-box-shadow;
43
- }
44
- }
45
-
46
- &:focus:not(:checked) ~ .custom-control-label::before {
47
- border-color: $custom-control-indicator-focus-border-color;
48
- }
49
-
50
- &:not(:disabled):active ~ .custom-control-label::before {
51
- color: $custom-control-indicator-active-color;
52
- background-color: $custom-control-indicator-active-bg;
53
- border-color: $custom-control-indicator-active-border-color;
54
- @include box-shadow($custom-control-indicator-active-box-shadow);
55
- }
56
-
57
- // Use [disabled] and :disabled to work around https://github.com/twbs/bootstrap/issues/28247
58
- &[disabled],
59
- &:disabled {
60
- ~ .custom-control-label {
61
- color: $custom-control-label-disabled-color;
62
-
63
- &::before {
64
- background-color: $custom-control-indicator-disabled-bg;
65
- }
66
- }
67
- }
68
- }
69
-
70
- // Custom control indicators
71
- //
72
- // Build the custom controls out of pseudo-elements.
73
-
74
- .custom-control-label {
75
- position: relative;
76
- margin-bottom: 0;
77
- color: $custom-control-label-color;
78
- vertical-align: top;
79
- cursor: $custom-control-cursor;
80
-
81
- // Background-color and (when enabled) gradient
82
- &::before {
83
- position: absolute;
84
- top: ($font-size-base * $line-height-base - $custom-control-indicator-size) / 2;
85
- left: -($custom-control-gutter + $custom-control-indicator-size);
86
- display: block;
87
- width: $custom-control-indicator-size;
88
- height: $custom-control-indicator-size;
89
- pointer-events: none;
90
- content: "";
91
- background-color: $custom-control-indicator-bg;
92
- border: $custom-control-indicator-border-color solid $custom-control-indicator-border-width;
93
- @include box-shadow($custom-control-indicator-box-shadow);
94
- }
95
-
96
- // Foreground (icon)
97
- &::after {
98
- position: absolute;
99
- top: ($font-size-base * $line-height-base - $custom-control-indicator-size) / 2;
100
- left: -($custom-control-gutter + $custom-control-indicator-size);
101
- display: block;
102
- width: $custom-control-indicator-size;
103
- height: $custom-control-indicator-size;
104
- content: "";
105
- background: no-repeat 50% / #{$custom-control-indicator-bg-size};
106
- }
107
- }
108
-
109
-
110
- // Checkboxes
111
- //
112
- // Tweak just a few things for checkboxes.
113
-
114
- .custom-checkbox {
115
- .custom-control-label::before {
116
- @include border-radius($custom-checkbox-indicator-border-radius);
117
- }
118
-
119
- .custom-control-input:checked ~ .custom-control-label {
120
- &::after {
121
- background-image: escape-svg($custom-checkbox-indicator-icon-checked);
122
- }
123
- }
124
-
125
- .custom-control-input:indeterminate ~ .custom-control-label {
126
- &::before {
127
- border-color: $custom-checkbox-indicator-indeterminate-border-color;
128
- @include gradient-bg($custom-checkbox-indicator-indeterminate-bg);
129
- @include box-shadow($custom-checkbox-indicator-indeterminate-box-shadow);
130
- }
131
- &::after {
132
- background-image: escape-svg($custom-checkbox-indicator-icon-indeterminate);
133
- }
134
- }
135
-
136
- .custom-control-input:disabled {
137
- &:checked ~ .custom-control-label::before {
138
- background-color: $custom-control-indicator-checked-disabled-bg;
139
- }
140
- &:indeterminate ~ .custom-control-label::before {
141
- background-color: $custom-control-indicator-checked-disabled-bg;
142
- }
143
- }
144
- }
145
-
146
- // Radios
147
- //
148
- // Tweak just a few things for radios.
149
-
150
- .custom-radio {
151
- .custom-control-label::before {
152
- // stylelint-disable-next-line property-blacklist
153
- border-radius: $custom-radio-indicator-border-radius;
154
- }
155
-
156
- .custom-control-input:checked ~ .custom-control-label {
157
- &::after {
158
- background-image: escape-svg($custom-radio-indicator-icon-checked);
159
- }
160
- }
161
-
162
- .custom-control-input:disabled {
163
- &:checked ~ .custom-control-label::before {
164
- background-color: $custom-control-indicator-checked-disabled-bg;
165
- }
166
- }
167
- }
168
-
169
-
170
- // switches
171
- //
172
- // Tweak a few things for switches
173
-
174
- .custom-switch {
175
- padding-left: $custom-switch-width + $custom-control-gutter;
176
-
177
- .custom-control-label {
178
- &::before {
179
- left: -($custom-switch-width + $custom-control-gutter);
180
- width: $custom-switch-width;
181
- pointer-events: all;
182
- // stylelint-disable-next-line property-blacklist
183
- border-radius: $custom-switch-indicator-border-radius;
184
- }
185
-
186
- &::after {
187
- top: add(($font-size-base * $line-height-base - $custom-control-indicator-size) / 2, $custom-control-indicator-border-width * 2);
188
- left: add(-($custom-switch-width + $custom-control-gutter), $custom-control-indicator-border-width * 2);
189
- width: $custom-switch-indicator-size;
190
- height: $custom-switch-indicator-size;
191
- background-color: $custom-control-indicator-border-color;
192
- // stylelint-disable-next-line property-blacklist
193
- border-radius: $custom-switch-indicator-border-radius;
194
- @include transition(transform .15s ease-in-out, $custom-forms-transition);
195
- }
196
- }
197
-
198
- .custom-control-input:checked ~ .custom-control-label {
199
- &::after {
200
- background-color: $custom-control-indicator-bg;
201
- transform: translateX($custom-switch-width - $custom-control-indicator-size);
202
- }
203
- }
204
-
205
- .custom-control-input:disabled {
206
- &:checked ~ .custom-control-label::before {
207
- background-color: $custom-control-indicator-checked-disabled-bg;
208
- }
209
- }
210
- }
211
-
212
-
213
- // Select
214
- //
215
- // Replaces the browser default select with a custom one, mostly pulled from
216
- // https://primer.github.io/.
217
- //
218
-
219
- .custom-select {
220
- display: inline-block;
221
- width: 100%;
222
- height: $custom-select-height;
223
- padding: $custom-select-padding-y ($custom-select-padding-x + $custom-select-indicator-padding) $custom-select-padding-y $custom-select-padding-x;
224
- font-family: $custom-select-font-family;
225
- @include font-size($custom-select-font-size);
226
- font-weight: $custom-select-font-weight;
227
- line-height: $custom-select-line-height;
228
- color: $custom-select-color;
229
- vertical-align: middle;
230
- background: $custom-select-bg $custom-select-background;
231
- border: $custom-select-border-width solid $custom-select-border-color;
232
- @include border-radius($custom-select-border-radius, 0);
233
- @include box-shadow($custom-select-box-shadow);
234
- appearance: none;
235
-
236
- &:focus {
237
- border-color: $custom-select-focus-border-color;
238
- outline: 0;
239
- @if $enable-shadows {
240
- box-shadow: $custom-select-box-shadow, $custom-select-focus-box-shadow;
241
- } @else {
242
- box-shadow: $custom-select-focus-box-shadow;
243
- }
244
-
245
- &::-ms-value {
246
- // For visual consistency with other platforms/browsers,
247
- // suppress the default white text on blue background highlight given to
248
- // the selected option text when the (still closed) <select> receives focus
249
- // in IE and (under certain conditions) Edge.
250
- // See https://github.com/twbs/bootstrap/issues/19398.
251
- color: $input-color;
252
- background-color: $input-bg;
253
- }
254
- }
255
-
256
- &[multiple],
257
- &[size]:not([size="1"]) {
258
- height: auto;
259
- padding-right: $custom-select-padding-x;
260
- background-image: none;
261
- }
262
-
263
- &:disabled {
264
- color: $custom-select-disabled-color;
265
- background-color: $custom-select-disabled-bg;
266
- }
267
-
268
- // Hides the default caret in IE11
269
- &::-ms-expand {
270
- display: none;
271
- }
272
-
273
- // Remove outline from select box in FF
274
- &:-moz-focusring {
275
- color: transparent;
276
- text-shadow: 0 0 0 $custom-select-color;
277
- }
278
- }
279
-
280
- .custom-select-sm {
281
- height: $custom-select-height-sm;
282
- padding-top: $custom-select-padding-y-sm;
283
- padding-bottom: $custom-select-padding-y-sm;
284
- padding-left: $custom-select-padding-x-sm;
285
- @include font-size($custom-select-font-size-sm);
286
- }
287
-
288
- .custom-select-lg {
289
- height: $custom-select-height-lg;
290
- padding-top: $custom-select-padding-y-lg;
291
- padding-bottom: $custom-select-padding-y-lg;
292
- padding-left: $custom-select-padding-x-lg;
293
- @include font-size($custom-select-font-size-lg);
294
- }
295
-
296
-
297
- // File
298
- //
299
- // Custom file input.
300
-
301
- .custom-file {
302
- position: relative;
303
- display: inline-block;
304
- width: 100%;
305
- height: $custom-file-height;
306
- margin-bottom: 0;
307
- }
308
-
309
- .custom-file-input {
310
- position: relative;
311
- z-index: 2;
312
- width: 100%;
313
- height: $custom-file-height;
314
- margin: 0;
315
- opacity: 0;
316
-
317
- &:focus ~ .custom-file-label {
318
- border-color: $custom-file-focus-border-color;
319
- box-shadow: $custom-file-focus-box-shadow;
320
- }
321
-
322
- // Use [disabled] and :disabled to work around https://github.com/twbs/bootstrap/issues/28247
323
- &[disabled] ~ .custom-file-label,
324
- &:disabled ~ .custom-file-label {
325
- background-color: $custom-file-disabled-bg;
326
- }
327
-
328
- @each $lang, $value in $custom-file-text {
329
- &:lang(#{$lang}) ~ .custom-file-label::after {
330
- content: $value;
331
- }
332
- }
333
-
334
- ~ .custom-file-label[data-browse]::after {
335
- content: attr(data-browse);
336
- }
337
- }
338
-
339
- .custom-file-label {
340
- position: absolute;
341
- top: 0;
342
- right: 0;
343
- left: 0;
344
- z-index: 1;
345
- height: $custom-file-height;
346
- padding: $custom-file-padding-y $custom-file-padding-x;
347
- font-family: $custom-file-font-family;
348
- font-weight: $custom-file-font-weight;
349
- line-height: $custom-file-line-height;
350
- color: $custom-file-color;
351
- background-color: $custom-file-bg;
352
- border: $custom-file-border-width solid $custom-file-border-color;
353
- @include border-radius($custom-file-border-radius);
354
- @include box-shadow($custom-file-box-shadow);
355
-
356
- &::after {
357
- position: absolute;
358
- top: 0;
359
- right: 0;
360
- bottom: 0;
361
- z-index: 3;
362
- display: block;
363
- height: $custom-file-height-inner;
364
- padding: $custom-file-padding-y $custom-file-padding-x;
365
- line-height: $custom-file-line-height;
366
- color: $custom-file-button-color;
367
- content: "Browse";
368
- @include gradient-bg($custom-file-button-bg);
369
- border-left: inherit;
370
- @include border-radius(0 $custom-file-border-radius $custom-file-border-radius 0);
371
- }
372
- }
373
-
374
- // Range
375
- //
376
- // Style range inputs the same across browsers. Vendor-specific rules for pseudo
377
- // elements cannot be mixed. As such, there are no shared styles for focus or
378
- // active states on prefixed selectors.
379
-
380
- .custom-range {
381
- width: 100%;
382
- height: add($custom-range-thumb-height, $custom-range-thumb-focus-box-shadow-width * 2);
383
- padding: 0; // Need to reset padding
384
- background-color: transparent;
385
- appearance: none;
386
-
387
- &:focus {
388
- outline: none;
389
-
390
- // Pseudo-elements must be split across multiple rulesets to have an effect.
391
- // No box-shadow() mixin for focus accessibility.
392
- &::-webkit-slider-thumb { box-shadow: $custom-range-thumb-focus-box-shadow; }
393
- &::-moz-range-thumb { box-shadow: $custom-range-thumb-focus-box-shadow; }
394
- &::-ms-thumb { box-shadow: $custom-range-thumb-focus-box-shadow; }
395
- }
396
-
397
- &::-moz-focus-outer {
398
- border: 0;
399
- }
400
-
401
- &::-webkit-slider-thumb {
402
- width: $custom-range-thumb-width;
403
- height: $custom-range-thumb-height;
404
- margin-top: ($custom-range-track-height - $custom-range-thumb-height) / 2; // Webkit specific
405
- @include gradient-bg($custom-range-thumb-bg);
406
- border: $custom-range-thumb-border;
407
- @include border-radius($custom-range-thumb-border-radius);
408
- @include box-shadow($custom-range-thumb-box-shadow);
409
- @include transition($custom-forms-transition);
410
- appearance: none;
411
-
412
- &:active {
413
- @include gradient-bg($custom-range-thumb-active-bg);
414
- }
415
- }
416
-
417
- &::-webkit-slider-runnable-track {
418
- width: $custom-range-track-width;
419
- height: $custom-range-track-height;
420
- color: transparent; // Why?
421
- cursor: $custom-range-track-cursor;
422
- background-color: $custom-range-track-bg;
423
- border-color: transparent;
424
- @include border-radius($custom-range-track-border-radius);
425
- @include box-shadow($custom-range-track-box-shadow);
426
- }
427
-
428
- &::-moz-range-thumb {
429
- width: $custom-range-thumb-width;
430
- height: $custom-range-thumb-height;
431
- @include gradient-bg($custom-range-thumb-bg);
432
- border: $custom-range-thumb-border;
433
- @include border-radius($custom-range-thumb-border-radius);
434
- @include box-shadow($custom-range-thumb-box-shadow);
435
- @include transition($custom-forms-transition);
436
- appearance: none;
437
-
438
- &:active {
439
- @include gradient-bg($custom-range-thumb-active-bg);
440
- }
441
- }
442
-
443
- &::-moz-range-track {
444
- width: $custom-range-track-width;
445
- height: $custom-range-track-height;
446
- color: transparent;
447
- cursor: $custom-range-track-cursor;
448
- background-color: $custom-range-track-bg;
449
- border-color: transparent; // Firefox specific?
450
- @include border-radius($custom-range-track-border-radius);
451
- @include box-shadow($custom-range-track-box-shadow);
452
- }
453
-
454
- &::-ms-thumb {
455
- width: $custom-range-thumb-width;
456
- height: $custom-range-thumb-height;
457
- margin-top: 0; // Edge specific
458
- margin-right: $custom-range-thumb-focus-box-shadow-width; // Workaround that overflowed box-shadow is hidden.
459
- margin-left: $custom-range-thumb-focus-box-shadow-width; // Workaround that overflowed box-shadow is hidden.
460
- @include gradient-bg($custom-range-thumb-bg);
461
- border: $custom-range-thumb-border;
462
- @include border-radius($custom-range-thumb-border-radius);
463
- @include box-shadow($custom-range-thumb-box-shadow);
464
- @include transition($custom-forms-transition);
465
- appearance: none;
466
-
467
- &:active {
468
- @include gradient-bg($custom-range-thumb-active-bg);
469
- }
470
- }
471
-
472
- &::-ms-track {
473
- width: $custom-range-track-width;
474
- height: $custom-range-track-height;
475
- color: transparent;
476
- cursor: $custom-range-track-cursor;
477
- background-color: transparent;
478
- border-color: transparent;
479
- border-width: $custom-range-thumb-height / 2;
480
- @include box-shadow($custom-range-track-box-shadow);
481
- }
482
-
483
- &::-ms-fill-lower {
484
- background-color: $custom-range-track-bg;
485
- @include border-radius($custom-range-track-border-radius);
486
- }
487
-
488
- &::-ms-fill-upper {
489
- margin-right: 15px; // arbitrary?
490
- background-color: $custom-range-track-bg;
491
- @include border-radius($custom-range-track-border-radius);
492
- }
493
-
494
- &:disabled {
495
- &::-webkit-slider-thumb {
496
- background-color: $custom-range-thumb-disabled-bg;
497
- }
498
-
499
- &::-webkit-slider-runnable-track {
500
- cursor: default;
501
- }
502
-
503
- &::-moz-range-thumb {
504
- background-color: $custom-range-thumb-disabled-bg;
505
- }
506
-
507
- &::-moz-range-track {
508
- cursor: default;
509
- }
510
-
511
- &::-ms-thumb {
512
- background-color: $custom-range-thumb-disabled-bg;
513
- }
514
- }
515
- }
516
-
517
- .custom-control-label::before,
518
- .custom-file-label,
519
- .custom-select {
520
- @include transition($custom-forms-transition);
521
- }