|
| 1 | +/*! |
| 2 | + * Bootstrap v4.6.2 (https://getbootstrap.com/) |
| 3 | + * Copyright 2011-2022 The Bootstrap Authors |
| 4 | + * Copyright 2011-2022 Twitter, Inc. |
| 5 | + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) |
| 6 | + * |
| 7 | + * DO NOT MODIFY THIS FILE. It preserves compatibility with Bootstrap 4.6 docs. |
| 8 | + */ |
| 9 | + |
| 10 | +// stylelint-disable selector-no-qualifying-type |
| 11 | + |
| 12 | +// Make the div behave like a button |
| 13 | +.btn-group, |
| 14 | +.btn-group-vertical { |
| 15 | + position: relative; |
| 16 | + display: inline-flex; |
| 17 | + vertical-align: middle; // match .btn alignment given font-size hack above |
| 18 | + |
| 19 | + > .btn { |
| 20 | + position: relative; |
| 21 | + flex: 1 1 auto; |
| 22 | + |
| 23 | + // Bring the hover, focused, and "active" buttons to the front to overlay |
| 24 | + // the borders properly |
| 25 | + @include hover() { |
| 26 | + z-index: 1; |
| 27 | + } |
| 28 | + |
| 29 | + &:focus, |
| 30 | + &:active, |
| 31 | + &.active { |
| 32 | + z-index: 1; |
| 33 | + } |
| 34 | + } |
| 35 | +} |
| 36 | + |
| 37 | +// Optional: Group multiple button groups together for a toolbar |
| 38 | +.btn-toolbar { |
| 39 | + display: flex; |
| 40 | + flex-wrap: wrap; |
| 41 | + justify-content: flex-start; |
| 42 | + |
| 43 | + .input-group { |
| 44 | + width: auto; |
| 45 | + } |
| 46 | +} |
| 47 | + |
| 48 | +.btn-group { |
| 49 | + // Prevent double borders when buttons are next to each other |
| 50 | + > .btn:not(:first-child), |
| 51 | + > .btn-group:not(:first-child) { |
| 52 | + margin-left: -$btn-border-width; |
| 53 | + } |
| 54 | + |
| 55 | + // Reset rounded corners |
| 56 | + > .btn:not(:last-child):not(.dropdown-toggle), |
| 57 | + > .btn-group:not(:last-child) > .btn { |
| 58 | + @include border-right-radius(0); |
| 59 | + } |
| 60 | + |
| 61 | + > .btn:not(:first-child), |
| 62 | + > .btn-group:not(:first-child) > .btn { |
| 63 | + @include border-left-radius(0); |
| 64 | + } |
| 65 | +} |
| 66 | + |
| 67 | +// Sizing |
| 68 | +// |
| 69 | +// Remix the default button sizing classes into new ones for easier manipulation. |
| 70 | + |
| 71 | +.btn-group-sm > .btn { |
| 72 | + @extend .btn-sm; |
| 73 | +} |
| 74 | + |
| 75 | +.btn-group-lg > .btn { |
| 76 | + @extend .btn-lg; |
| 77 | +} |
| 78 | + |
| 79 | + |
| 80 | +// |
| 81 | +// Split button dropdowns |
| 82 | +// |
| 83 | + |
| 84 | +.dropdown-toggle-split { |
| 85 | + padding-right: $btn-padding-x * .75; |
| 86 | + padding-left: $btn-padding-x * .75; |
| 87 | + |
| 88 | + &::after, |
| 89 | + .dropup &::after, |
| 90 | + .dropright &::after { |
| 91 | + margin-left: 0; |
| 92 | + } |
| 93 | + |
| 94 | + .dropleft &::before { |
| 95 | + margin-right: 0; |
| 96 | + } |
| 97 | +} |
| 98 | + |
| 99 | +.btn-sm + .dropdown-toggle-split { |
| 100 | + padding-right: $btn-padding-x-sm * .75; |
| 101 | + padding-left: $btn-padding-x-sm * .75; |
| 102 | +} |
| 103 | + |
| 104 | +.btn-lg + .dropdown-toggle-split { |
| 105 | + padding-right: $btn-padding-x-lg * .75; |
| 106 | + padding-left: $btn-padding-x-lg * .75; |
| 107 | +} |
| 108 | + |
| 109 | + |
| 110 | +// The clickable button for toggling the menu |
| 111 | +// Set the same inset shadow as the :active state |
| 112 | +.btn-group.show .dropdown-toggle { |
| 113 | + @include box-shadow($btn-active-box-shadow); |
| 114 | + |
| 115 | + // Show no shadow for `.btn-link` since it has no other button styles. |
| 116 | + &.btn-link { |
| 117 | + @include box-shadow(none); |
| 118 | + } |
| 119 | +} |
| 120 | + |
| 121 | + |
| 122 | +// |
| 123 | +// Vertical button groups |
| 124 | +// |
| 125 | + |
| 126 | +.btn-group-vertical { |
| 127 | + flex-direction: column; |
| 128 | + align-items: flex-start; |
| 129 | + justify-content: center; |
| 130 | + |
| 131 | + > .btn, |
| 132 | + > .btn-group { |
| 133 | + width: 100%; |
| 134 | + } |
| 135 | + |
| 136 | + > .btn:not(:first-child), |
| 137 | + > .btn-group:not(:first-child) { |
| 138 | + margin-top: -$btn-border-width; |
| 139 | + } |
| 140 | + |
| 141 | + // Reset rounded corners |
| 142 | + > .btn:not(:last-child):not(.dropdown-toggle), |
| 143 | + > .btn-group:not(:last-child) > .btn { |
| 144 | + @include border-bottom-radius(0); |
| 145 | + } |
| 146 | + |
| 147 | + > .btn:not(:first-child), |
| 148 | + > .btn-group:not(:first-child) > .btn { |
| 149 | + @include border-top-radius(0); |
| 150 | + } |
| 151 | +} |
| 152 | + |
| 153 | + |
| 154 | +// Checkbox and radio options |
| 155 | +// |
| 156 | +// In order to support the browser's form validation feedback, powered by the |
| 157 | +// `required` attribute, we have to "hide" the inputs via `clip`. We cannot use |
| 158 | +// `display: none;` or `visibility: hidden;` as that also hides the popover. |
| 159 | +// Simply visually hiding the inputs via `opacity` would leave them clickable in |
| 160 | +// certain cases which is prevented by using `clip` and `pointer-events`. |
| 161 | +// This way, we ensure a DOM element is visible to position the popover from. |
| 162 | +// |
| 163 | +// See https://github.com/twbs/bootstrap/pull/12794 and |
| 164 | +// https://github.com/twbs/bootstrap/pull/14559 for more information. |
| 165 | + |
| 166 | +.btn-group-toggle { |
| 167 | + > .btn, |
| 168 | + > .btn-group > .btn { |
| 169 | + margin-bottom: 0; // Override default `<label>` value |
| 170 | + |
| 171 | + input[type="radio"], |
| 172 | + input[type="checkbox"] { |
| 173 | + position: absolute; |
| 174 | + clip: rect(0, 0, 0, 0); |
| 175 | + pointer-events: none; |
| 176 | + } |
| 177 | + } |
| 178 | +} |
0 commit comments