_cards.scss 6.3 KB
Newer Older
C
chomik 已提交
1
.card {
C
codecalm 已提交
2
  margin-bottom: $cards-grid-gap;
C
codecalm 已提交
3 4
  box-shadow: $card-shadow;

C
codecalm 已提交
5 6
  @include media-breakpoint-down($cards-grid-breakpoint) {
    margin-bottom: $cards-grid-gap-sm;
C
codecalm 已提交
7 8
  }

C
codecalm 已提交
9 10 11 12 13
  @media print {
    border: none;
    box-shadow: none;
  }

C
codecalm 已提交
14 15 16 17 18 19 20 21 22
  @at-root a#{&} {
    color: inherit;
    transition: .3s box-shadow;

    &:hover {
      text-decoration: none;
      box-shadow: $card-shadow-hover;
    }
  }
C
chomik 已提交
23 24
}

C
codecalm 已提交
25 26
.card-sm {
  .card-body {
C
codecalm 已提交
27
    padding: map-get($spacers, 3);
C
codecalm 已提交
28 29 30
  }
}

31 32
.card-md {
  .card-body {
C
codecalm 已提交
33 34 35
    @include media-breakpoint-up(md) {
      padding: map-get($spacers, 6);
    }
36 37 38
  }
}

C
codecalm 已提交
39 40 41 42 43 44
.card-group {
  margin-bottom: $card-group-margin;
}

.card-inactive {
  pointer-events: none;
C
codecalm 已提交
45
  box-shadow: none;
C
codecalm 已提交
46 47 48 49 50 51 52 53 54 55

  .card-body {
    opacity: .64;
  }
}

.card-active {
  position: relative;
  background-color: rgba($primary, .03);

C
codecalm 已提交
56
  &::before {
C
codecalm 已提交
57 58 59 60
    position: absolute;
    top: -1px;
    right: -1px;
    bottom: -1px;
C
codecalm 已提交
61 62
    left: -1px;
    content: "";
C
codecalm 已提交
63 64 65
    border: 1px solid $primary;
    border-radius: inherit;
  }
C
codecalm 已提交
66 67
}

C
chomik 已提交
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
.card-link {
  color: inherit;

  &:hover {
    color: inherit;
    text-decoration: none;
    box-shadow: 0 1px 6px 0 rgba(0, 0, 0, .08);
  }
}

.card-btn {
  padding: $card-spacer-y $card-spacer-x;
  text-align: center;
  background: rgba($primary, .02);
  transition: .3s background;

  &:hover {
    text-decoration: none;
C
codecalm 已提交
86
    background: $active-bg;
C
chomik 已提交
87 88 89
  }
}

C
codecalm 已提交
90 91 92
.card-stacked {
  position: relative;

C
codecalm 已提交
93
  &::after {
C
codecalm 已提交
94 95 96
    position: absolute;
    top: -5px;
    right: 5px;
C
codecalm 已提交
97 98 99 100
    left: 5px;
    height: 5px;
    content: "";
    background: $card-bg;
C
codecalm 已提交
101 102 103 104 105
    border: 1px solid $card-border-color;
    border-radius: $card-border-radius $card-border-radius 0 0;
  }
}

C
chomik 已提交
106 107 108
.card-cover {
  position: relative;
  padding: $card-spacer-y $card-spacer-x;
C
codecalm 已提交
109
  background: #666666 no-repeat center/cover;
C
chomik 已提交
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132

  &::before {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: "";
    background: $light-black;
  }

  &:first-child,
  &:first-child::before {
    border-radius: $border-radius $border-radius 0 0;
  }
}

.card-cover-blurred {
  &::before {
    backdrop-filter: blur(2px);
  }
}

C
codecalm 已提交
133 134 135 136 137 138 139 140 141
.card-actions {
  margin-left: auto;
  font-size: $h5-font-size;

  a {
    text-decoration: none;
  }
}

C
chomik 已提交
142 143 144
.card-header {
  display: flex;
  align-items: center;
C
chomik 已提交
145
  background: transparent;
C
chomik 已提交
146 147 148
}

.card-header-tabs {
C
codecalm 已提交
149
  flex: 1;
C
chomik 已提交
150 151 152
  margin: (- $card-spacer-y) (- $card-spacer-x);
}

C
codecalm 已提交
153 154 155 156
.card-header-pills {
  flex: 1;
}

C
codecalm 已提交
157 158 159 160
.card-footer {
  color: $text-muted;
}

C
chomik 已提交
161
.card-progress {
162
  height: .25rem;
C
chomik 已提交
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178

  &:last-child {
    border-radius: 0 0 2px 2px;
  }

  &:first-child {
    border-radius: 2px 2px 0 0;
  }
}

.card-meta {
  color: $text-muted;
}

.card-title {
  display: block;
C
codecalm 已提交
179
  margin: 0 0 1rem;
180
  font-size: $h3-font-size;
C
codecalm 已提交
181
  font-weight: $headings-font-weight;
C
codecalm 已提交
182
  color: $headings-color;
C
codecalm 已提交
183
  line-height: (24/18);
C
chomik 已提交
184 185 186 187

  @at-root a#{&}:hover {
    color: inherit;
  }
C
chomik 已提交
188 189

  .card-header & {
190
    margin: .125rem 0;
C
chomik 已提交
191
  }
C
chomik 已提交
192 193
}

C
codecalm 已提交
194 195 196 197 198 199 200
.card-subtitle {
  margin-top: -$card-spacer-y;
  margin-bottom: $card-spacer-y / 2;
  font-size: $small-font-size;
  color: $text-muted;
}

C
chomik 已提交
201
.card-body {
C
codecalm 已提交
202 203 204 205
  @media print {
    padding: 0;
  }

C
chomik 已提交
206 207 208
  > :last-child {
    margin-bottom: 0;
  }
C
codecalm 已提交
209 210 211 212

  & + & {
    border-top: 1px solid $border-color;
  }
C
chomik 已提交
213 214 215 216 217 218
}

.card-body-scrollable {
  overflow: auto;
}

C
chomik 已提交
219 220 221
/**
Card optinos
 */
C
chomik 已提交
222 223 224
.card-options {
  top: 1.5rem;
  right: .75rem;
M
mrszympek 已提交
225
  display: flex;
C
codecalm 已提交
226
  margin-left: auto;
C
chomik 已提交
227 228
}

C
chomik 已提交
229 230 231
.card-options-link {
  display: inline-block;
  min-width: 1rem;
C
chomik 已提交
232
  margin-left: .25rem;
C
codecalm 已提交
233
  color: $text-muted;
C
chomik 已提交
234 235
}

C
codecalm 已提交
236 237 238 239 240 241 242 243 244 245 246
.card-drop {
  line-height: 1;
  color: $text-muted;

  .icon {
    width: 1.5rem;
    height: 1.5rem;
    stroke-width: 1;
  }
}

C
chomik 已提交
247 248 249
/**
Card status
 */
M
mrszympek 已提交
250 251 252 253 254
.card-status-top {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
C
codecalm 已提交
255 256
  height: $card-status-size;
  border-radius: $card-border-radius $card-border-radius 0 0;
M
mrszympek 已提交
257 258 259 260 261 262
}

.card-status-left {
  position: absolute;
  right: auto;
  bottom: 0;
C
codecalm 已提交
263
  width: $card-status-size;
C
codecalm 已提交
264
  height: 100%;
M
mrszympek 已提交
265
  border-radius: $card-border-radius 0 0 $card-border-radius;
C
chomik 已提交
266 267
}

C
chomik 已提交
268
.card-status-bottom {
M
mrszympek 已提交
269
  position: absolute;
C
codecalm 已提交
270
  top: initial;
M
mrszympek 已提交
271 272
  bottom: 0;
  width: 100%;
C
codecalm 已提交
273
  height: $card-status-size;
C
chomik 已提交
274 275 276
  border-radius: 0 0 $card-border-radius $card-border-radius;
}

C
chomik 已提交
277 278 279
/**
Card table
 */
C
chomik 已提交
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
.card-table {
  margin-bottom: 0;

  tr {
    &:first-child {
      td,
      th {
        border-top: 0;
      }
    }

    td,
    th {
      border-top: 1px solid $border-color;

      &:first-child {
        padding-left: $card-spacer-x;
      }

      &:last-child {
        padding-right: $card-spacer-x;
      }
    }
  }

  .card-body + & {
    border-top: 1px solid $border-color;
  }
}

C
chomik 已提交
310 311 312
/*
Card code
 */
C
chomik 已提交
313
.card-code {
314
  padding: 0;
C
chomik 已提交
315 316

  .highlight {
317
    @extend .highlight-dark;
C
chomik 已提交
318
    margin: 0;
319
    border: 0;
C
chomik 已提交
320 321 322 323
  }

  pre {
    margin: 0;
C
codecalm 已提交
324
    color: #ffffff;
C
chomik 已提交
325 326 327 328
    text-shadow: none;
    background: transparent;
  }
}
C
chomik 已提交
329 330 331 332 333 334 335

/*
Card chart
 */
.card-chart {
  position: relative;
  z-index: 1;
C
chomik 已提交
336
  height: 3.5rem;
C
chomik 已提交
337
}
M
mrszympek 已提交
338

C
codecalm 已提交
339 340
/**
Card avatar
M
mrszympek 已提交
341
 */
C
codecalm 已提交
342 343
.card-avatar {
  box-shadow: 0 0 0 .5rem $card-bg;
M
mrszympek 已提交
344 345 346 347 348 349 350 351 352 353 354
}

/*
Card list group
 */
.card-list-group {
  .card-body + & {
    border-top: 1px solid $border-color;
  }

  .list-group-item {
C
codecalm 已提交
355 356
    padding-right: $card-spacer-x;
    padding-left: $card-spacer-x;
M
mrszympek 已提交
357 358 359 360 361 362 363 364 365 366 367 368 369
    border-right: 0;
    border-left: 0;
    border-radius: 0;

    &:last-child {
      border-bottom: 0;
    }

    &:first-child {
      border-top: 0;
    }
  }
}
C
codecalm 已提交
370 371 372 373 374

/**
Card tabs
 */
.card-tabs {
C
codecalm 已提交
375 376
  margin-bottom: $card-group-margin;

C
codecalm 已提交
377 378
  .nav-tabs {
    position: relative;
C
codecalm 已提交
379 380
    z-index: $zindex-dropdown;
    border-bottom: 0;
C
codecalm 已提交
381 382

    .nav-link {
C
codecalm 已提交
383
      background: $card-cap-bg;
C
codecalm 已提交
384 385 386 387 388 389 390 391 392 393 394
      border: $card-border-width solid $card-border-color;
      border-bottom: 0;

      &.active,
      &:active,
      &:hover {
        border-color: $card-border-color;
      }

      &.active {
        color: $headings-color;
C
codecalm 已提交
395
        background: $card-bg;
C
codecalm 已提交
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417
      }
    }

    .nav-item {
      &:not(:first-child) {
        .nav-link {
          border-top-left-radius: 0;
        }
      }

      &:not(:last-child) {
        .nav-link {
          border-top-right-radius: 0;
        }
      }

      + .nav-item {
        margin-left: -1px;
      }
    }
  }

C
codecalm 已提交
418 419 420 421 422 423 424 425 426
  .nav-tabs-bottom {
    margin-bottom: 0;

    .nav-item {
      margin-top: -1px;
      margin-bottom: 0;

      .nav-link {
        border-top-width: 0;
C
codecalm 已提交
427
        border-bottom: $card-border-width solid $card-border-color;
C
codecalm 已提交
428 429 430 431 432 433 434

        border-top-left-radius: 0;
        border-top-right-radius: 0;
      }
    }
  }

C
codecalm 已提交
435
  .card {
C
codecalm 已提交
436
    margin: 0;
C
codecalm 已提交
437
    border-top-left-radius: 0;
C
codecalm 已提交
438 439
  }
}