mixins
6 years ago
utilities
6 years ago
vendor
6 years ago
_alert.scss
6 years ago
_badge.scss
6 years ago
_breadcrumb.scss
6 years ago
_button-group.scss
6 years ago
_buttons.scss
6 years ago
_card.scss
6 years ago
_carousel.scss
6 years ago
_close.scss
6 years ago
_code.scss
6 years ago
_custom-forms.scss
6 years ago
_dropdown.scss
6 years ago
_forms.scss
6 years ago
_functions.scss
6 years ago
_grid.scss
6 years ago
_images.scss
6 years ago
_input-group.scss
6 years ago
_jumbotron.scss
6 years ago
_list-group.scss
6 years ago
_media.scss
6 years ago
_mixins.scss
6 years ago
_modal.scss
6 years ago
_nav.scss
6 years ago
_navbar.scss
6 years ago
_pagination.scss
6 years ago
_popover.scss
6 years ago
_print.scss
6 years ago
_progress.scss
6 years ago
_reboot.scss
6 years ago
_root.scss
6 years ago
_spinners.scss
6 years ago
_tables.scss
6 years ago
_toasts.scss
6 years ago
_tooltip.scss
6 years ago
_transitions.scss
6 years ago
_type.scss
6 years ago
_utilities.scss
6 years ago
_variables.scss
6 years ago
bootstrap-grid.scss
6 years ago
bootstrap-reboot.scss
6 years ago
bootstrap.scss
6 years ago
_card.scss
290 lines
| 1 | // |
| 2 | // Base styles |
| 3 | // |
| 4 | |
| 5 | .card { |
| 6 | position: relative; |
| 7 | display: flex; |
| 8 | flex-direction: column; |
| 9 | min-width: 0; // See https://github.com/twbs/bootstrap/pull/22740#issuecomment-305868106 |
| 10 | word-wrap: break-word; |
| 11 | background-color: $card-bg; |
| 12 | background-clip: border-box; |
| 13 | border: $card-border-width solid $card-border-color; |
| 14 | @include border-radius($card-border-radius); |
| 15 | |
| 16 | > hr { |
| 17 | margin-right: 0; |
| 18 | margin-left: 0; |
| 19 | } |
| 20 | |
| 21 | > .list-group:first-child { |
| 22 | .list-group-item:first-child { |
| 23 | @include border-top-radius($card-border-radius); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | > .list-group:last-child { |
| 28 | .list-group-item:last-child { |
| 29 | @include border-bottom-radius($card-border-radius); |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | .card-body { |
| 35 | // Enable `flex-grow: 1` for decks and groups so that card blocks take up |
| 36 | // as much space as possible, ensuring footers are aligned to the bottom. |
| 37 | flex: 1 1 auto; |
| 38 | padding: $card-spacer-x; |
| 39 | color: $card-color; |
| 40 | } |
| 41 | |
| 42 | .card-title { |
| 43 | margin-bottom: $card-spacer-y; |
| 44 | } |
| 45 | |
| 46 | .card-subtitle { |
| 47 | margin-top: -$card-spacer-y / 2; |
| 48 | margin-bottom: 0; |
| 49 | } |
| 50 | |
| 51 | .card-text:last-child { |
| 52 | margin-bottom: 0; |
| 53 | } |
| 54 | |
| 55 | .card-link { |
| 56 | @include hover { |
| 57 | text-decoration: none; |
| 58 | } |
| 59 | |
| 60 | + .card-link { |
| 61 | margin-left: $card-spacer-x; |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | // |
| 66 | // Optional textual caps |
| 67 | // |
| 68 | |
| 69 | .card-header { |
| 70 | padding: $card-spacer-y $card-spacer-x; |
| 71 | margin-bottom: 0; // Removes the default margin-bottom of <hN> |
| 72 | color: $card-cap-color; |
| 73 | background-color: $card-cap-bg; |
| 74 | border-bottom: $card-border-width solid $card-border-color; |
| 75 | |
| 76 | &:first-child { |
| 77 | @include border-radius($card-inner-border-radius $card-inner-border-radius 0 0); |
| 78 | } |
| 79 | |
| 80 | + .list-group { |
| 81 | .list-group-item:first-child { |
| 82 | border-top: 0; |
| 83 | } |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | .card-footer { |
| 88 | padding: $card-spacer-y $card-spacer-x; |
| 89 | background-color: $card-cap-bg; |
| 90 | border-top: $card-border-width solid $card-border-color; |
| 91 | |
| 92 | &:last-child { |
| 93 | @include border-radius(0 0 $card-inner-border-radius $card-inner-border-radius); |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | |
| 98 | // |
| 99 | // Header navs |
| 100 | // |
| 101 | |
| 102 | .card-header-tabs { |
| 103 | margin-right: -$card-spacer-x / 2; |
| 104 | margin-bottom: -$card-spacer-y; |
| 105 | margin-left: -$card-spacer-x / 2; |
| 106 | border-bottom: 0; |
| 107 | } |
| 108 | |
| 109 | .card-header-pills { |
| 110 | margin-right: -$card-spacer-x / 2; |
| 111 | margin-left: -$card-spacer-x / 2; |
| 112 | } |
| 113 | |
| 114 | // Card image |
| 115 | .card-img-overlay { |
| 116 | position: absolute; |
| 117 | top: 0; |
| 118 | right: 0; |
| 119 | bottom: 0; |
| 120 | left: 0; |
| 121 | padding: $card-img-overlay-padding; |
| 122 | } |
| 123 | |
| 124 | .card-img { |
| 125 | width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch |
| 126 | @include border-radius($card-inner-border-radius); |
| 127 | } |
| 128 | |
| 129 | // Card image caps |
| 130 | .card-img-top { |
| 131 | width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch |
| 132 | @include border-top-radius($card-inner-border-radius); |
| 133 | } |
| 134 | |
| 135 | .card-img-bottom { |
| 136 | width: 100%; // Required because we use flexbox and this inherently applies align-self: stretch |
| 137 | @include border-bottom-radius($card-inner-border-radius); |
| 138 | } |
| 139 | |
| 140 | |
| 141 | // Card deck |
| 142 | |
| 143 | .card-deck { |
| 144 | display: flex; |
| 145 | flex-direction: column; |
| 146 | |
| 147 | .card { |
| 148 | margin-bottom: $card-deck-margin; |
| 149 | } |
| 150 | |
| 151 | @include media-breakpoint-up(sm) { |
| 152 | flex-flow: row wrap; |
| 153 | margin-right: -$card-deck-margin; |
| 154 | margin-left: -$card-deck-margin; |
| 155 | |
| 156 | .card { |
| 157 | display: flex; |
| 158 | // Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4 |
| 159 | flex: 1 0 0%; |
| 160 | flex-direction: column; |
| 161 | margin-right: $card-deck-margin; |
| 162 | margin-bottom: 0; // Override the default |
| 163 | margin-left: $card-deck-margin; |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | |
| 169 | // |
| 170 | // Card groups |
| 171 | // |
| 172 | |
| 173 | .card-group { |
| 174 | display: flex; |
| 175 | flex-direction: column; |
| 176 | |
| 177 | // The child selector allows nested `.card` within `.card-group` |
| 178 | // to display properly. |
| 179 | > .card { |
| 180 | margin-bottom: $card-group-margin; |
| 181 | } |
| 182 | |
| 183 | @include media-breakpoint-up(sm) { |
| 184 | flex-flow: row wrap; |
| 185 | // The child selector allows nested `.card` within `.card-group` |
| 186 | // to display properly. |
| 187 | > .card { |
| 188 | // Flexbugs #4: https://github.com/philipwalton/flexbugs#flexbug-4 |
| 189 | flex: 1 0 0%; |
| 190 | margin-bottom: 0; |
| 191 | |
| 192 | + .card { |
| 193 | margin-left: 0; |
| 194 | border-left: 0; |
| 195 | } |
| 196 | |
| 197 | // Handle rounded corners |
| 198 | @if $enable-rounded { |
| 199 | &:not(:last-child) { |
| 200 | @include border-right-radius(0); |
| 201 | |
| 202 | .card-img-top, |
| 203 | .card-header { |
| 204 | // stylelint-disable-next-line property-blacklist |
| 205 | border-top-right-radius: 0; |
| 206 | } |
| 207 | .card-img-bottom, |
| 208 | .card-footer { |
| 209 | // stylelint-disable-next-line property-blacklist |
| 210 | border-bottom-right-radius: 0; |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | &:not(:first-child) { |
| 215 | @include border-left-radius(0); |
| 216 | |
| 217 | .card-img-top, |
| 218 | .card-header { |
| 219 | // stylelint-disable-next-line property-blacklist |
| 220 | border-top-left-radius: 0; |
| 221 | } |
| 222 | .card-img-bottom, |
| 223 | .card-footer { |
| 224 | // stylelint-disable-next-line property-blacklist |
| 225 | border-bottom-left-radius: 0; |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | |
| 234 | // |
| 235 | // Columns |
| 236 | // |
| 237 | |
| 238 | .card-columns { |
| 239 | .card { |
| 240 | margin-bottom: $card-columns-margin; |
| 241 | } |
| 242 | |
| 243 | @include media-breakpoint-up(sm) { |
| 244 | column-count: $card-columns-count; |
| 245 | column-gap: $card-columns-gap; |
| 246 | orphans: 1; |
| 247 | widows: 1; |
| 248 | |
| 249 | .card { |
| 250 | display: inline-block; // Don't let them vertically span multiple columns |
| 251 | width: 100%; // Don't let their width change |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | |
| 257 | // |
| 258 | // Accordion |
| 259 | // |
| 260 | |
| 261 | .accordion { |
| 262 | > .card { |
| 263 | overflow: hidden; |
| 264 | |
| 265 | &:not(:first-of-type) { |
| 266 | .card-header:first-child { |
| 267 | @include border-radius(0); |
| 268 | } |
| 269 | |
| 270 | &:not(:last-of-type) { |
| 271 | border-bottom: 0; |
| 272 | @include border-radius(0); |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | &:first-of-type { |
| 277 | border-bottom: 0; |
| 278 | @include border-bottom-radius(0); |
| 279 | } |
| 280 | |
| 281 | &:last-of-type { |
| 282 | @include border-top-radius(0); |
| 283 | } |
| 284 | |
| 285 | .card-header { |
| 286 | margin-bottom: -$card-border-width; |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 |