_cards.scss 6.5 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 27 28 29 30
.card-group {
  margin-bottom: $card-group-margin;
}

.card-inactive {
  pointer-events: none;
C
codecalm 已提交
31
  box-shadow: none;
C
codecalm 已提交
32 33 34 35 36 37 38 39 40 41

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

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

C
codecalm 已提交
42
  &:before {
C
codecalm 已提交
43 44 45 46
    position: absolute;
    top: -1px;
    right: -1px;
    bottom: -1px;
C
codecalm 已提交
47 48
    left: -1px;
    content: "";
C
codecalm 已提交
49 50 51
    border: 1px solid $primary;
    border-radius: inherit;
  }
C
codecalm 已提交
52 53
}

C
chomik 已提交
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
.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 已提交
72
    background: $active-bg;
C
chomik 已提交
73 74 75
  }
}

C
codecalm 已提交
76 77 78
.card-stacked {
  position: relative;

C
codecalm 已提交
79
  &:after {
C
codecalm 已提交
80 81 82
    position: absolute;
    top: -5px;
    right: 5px;
C
codecalm 已提交
83 84 85 86
    left: 5px;
    height: 5px;
    content: "";
    background: $card-bg;
C
codecalm 已提交
87 88 89 90 91
    border: 1px solid $card-border-color;
    border-radius: $card-border-radius $card-border-radius 0 0;
  }
}

C
chomik 已提交
92 93 94
.card-cover {
  position: relative;
  padding: $card-spacer-y $card-spacer-x;
C
codecalm 已提交
95
  background: #666666 no-repeat center/cover;
C
chomik 已提交
96

C
codecalm 已提交
97
  &:before {
C
chomik 已提交
98 99 100 101 102 103 104 105 106 107
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    content: "";
    background: $light-black;
  }

  &:first-child,
C
codecalm 已提交
108
  &:first-child:before {
C
chomik 已提交
109 110 111 112 113
    border-radius: $border-radius $border-radius 0 0;
  }
}

.card-cover-blurred {
C
codecalm 已提交
114
  &:before {
C
chomik 已提交
115 116 117 118
    backdrop-filter: blur(2px);
  }
}

C
codecalm 已提交
119 120 121 122 123 124 125 126 127
.card-actions {
  margin-left: auto;
  font-size: $h5-font-size;

  a {
    text-decoration: none;
  }
}

C
chomik 已提交
128 129 130
.card-header {
  display: flex;
  align-items: center;
C
chomik 已提交
131
  background: transparent;
C
chomik 已提交
132 133 134
}

.card-header-tabs {
C
codecalm 已提交
135
  flex: 1;
C
chomik 已提交
136 137 138
  margin: (- $card-spacer-y) (- $card-spacer-x);
}

C
codecalm 已提交
139 140 141 142
.card-header-pills {
  flex: 1;
}

C
codecalm 已提交
143 144 145 146
.card-footer {
  color: $text-muted;
}

C
chomik 已提交
147
.card-progress {
148
  height: .25rem;
C
chomik 已提交
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164

  &: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 已提交
165
  margin: 0 0 1rem;
166
  font-size: $h3-font-size;
C
codecalm 已提交
167
  font-weight: $headings-font-weight;
C
codecalm 已提交
168
  color: $headings-color;
C
codecalm 已提交
169
  line-height: (24/18);
C
chomik 已提交
170 171 172 173

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

  .card-header & {
176
    margin: .125rem 0;
C
chomik 已提交
177
  }
C
chomik 已提交
178 179
}

C
codecalm 已提交
180 181 182 183 184 185 186
.card-subtitle {
  margin-top: -$card-spacer-y;
  margin-bottom: $card-spacer-y / 2;
  font-size: $small-font-size;
  color: $text-muted;
}

C
chomik 已提交
187
.card-body {
C
codecalm 已提交
188
  > :last-child {
C
codecalm 已提交
189 190 191
    margin-bottom: 0;
  }

C
codecalm 已提交
192
  .card-sm > & {
C
codecalm 已提交
193
    padding: .75rem;
C
codecalm 已提交
194 195
  }

C
codecalm 已提交
196
  .card-md > & {
C
codecalm 已提交
197
    @include media-breakpoint-up(md) {
C
codecalm 已提交
198
      padding: 1.5rem;
C
codecalm 已提交
199 200 201
    }
  }

C
codecalm 已提交
202
  .card-lg > & {
C
codecalm 已提交
203
    @include media-breakpoint-up(md) {
C
codecalm 已提交
204 205 206 207 208
      padding: 2rem;
    }

    @include media-breakpoint-up(lg) {
      padding: 4rem;
C
codecalm 已提交
209 210 211 212 213
    }
  }

  @media print {
    padding: 0;
C
chomik 已提交
214
  }
C
codecalm 已提交
215 216 217 218

  & + & {
    border-top: 1px solid $border-color;
  }
C
chomik 已提交
219 220 221 222 223 224
}

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

C
chomik 已提交
225 226 227
/**
Card optinos
 */
C
chomik 已提交
228 229 230
.card-options {
  top: 1.5rem;
  right: .75rem;
M
mrszympek 已提交
231
  display: flex;
C
codecalm 已提交
232
  margin-left: auto;
C
chomik 已提交
233 234
}

C
chomik 已提交
235 236 237
.card-options-link {
  display: inline-block;
  min-width: 1rem;
C
chomik 已提交
238
  margin-left: .25rem;
C
codecalm 已提交
239
  color: $text-muted;
C
chomik 已提交
240 241
}

C
codecalm 已提交
242 243 244 245 246 247 248 249 250 251 252
.card-drop {
  line-height: 1;
  color: $text-muted;

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

C
chomik 已提交
253 254 255
/**
Card status
 */
M
mrszympek 已提交
256 257 258 259 260
.card-status-top {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
C
codecalm 已提交
261 262
  height: $card-status-size;
  border-radius: $card-border-radius $card-border-radius 0 0;
M
mrszympek 已提交
263 264 265 266 267 268
}

.card-status-left {
  position: absolute;
  right: auto;
  bottom: 0;
C
codecalm 已提交
269
  width: $card-status-size;
C
codecalm 已提交
270
  height: 100%;
M
mrszympek 已提交
271
  border-radius: $card-border-radius 0 0 $card-border-radius;
C
chomik 已提交
272 273
}

C
chomik 已提交
274
.card-status-bottom {
M
mrszympek 已提交
275
  position: absolute;
C
codecalm 已提交
276
  top: initial;
M
mrszympek 已提交
277 278
  bottom: 0;
  width: 100%;
C
codecalm 已提交
279
  height: $card-status-size;
C
chomik 已提交
280 281 282
  border-radius: 0 0 $card-border-radius $card-border-radius;
}

C
chomik 已提交
283 284 285
/**
Card table
 */
C
chomik 已提交
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
.card-table {
  margin-bottom: 0;

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

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

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

C
codecalm 已提交
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323
  thead {
    tr {
      &:first-child {
        td,
        th {
          border-top: 0;
        }
      }
    }
  }

  tbody {
    tr:last-child {
      td,
      th {
        border-bottom: 0;
      }
    }
  }

C
chomik 已提交
324 325 326 327 328
  .card-body + & {
    border-top: 1px solid $border-color;
  }
}

C
chomik 已提交
329 330 331
/*
Card code
 */
C
chomik 已提交
332
.card-code {
333
  padding: 0;
C
chomik 已提交
334 335 336

  .highlight {
    margin: 0;
337
    border: 0;
C
chomik 已提交
338 339 340 341
  }

  pre {
    margin: 0;
C
codecalm 已提交
342
    color: #ffffff;
C
chomik 已提交
343 344 345 346
    text-shadow: none;
    background: transparent;
  }
}
C
chomik 已提交
347 348 349 350 351 352 353

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

C
codecalm 已提交
357 358
/**
Card avatar
M
mrszympek 已提交
359
 */
C
codecalm 已提交
360 361
.card-avatar {
  box-shadow: 0 0 0 .5rem $card-bg;
M
mrszympek 已提交
362 363 364 365 366 367 368 369 370 371 372
}

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

  .list-group-item {
C
codecalm 已提交
373 374
    padding-right: $card-spacer-x;
    padding-left: $card-spacer-x;
M
mrszympek 已提交
375 376 377 378 379 380 381 382 383 384 385 386 387
    border-right: 0;
    border-left: 0;
    border-radius: 0;

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

    &:first-child {
      border-top: 0;
    }
  }
}
C
codecalm 已提交
388 389 390 391 392

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

C
codecalm 已提交
395 396
  .nav-tabs {
    position: relative;
C
codecalm 已提交
397 398
    z-index: $zindex-dropdown;
    border-bottom: 0;
C
codecalm 已提交
399 400

    .nav-link {
C
codecalm 已提交
401
      background: $card-cap-bg;
C
codecalm 已提交
402 403 404 405 406 407 408 409 410 411 412
      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 已提交
413
        background: $card-bg;
C
codecalm 已提交
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
      }
    }

    .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 已提交
436 437 438 439 440 441 442 443 444
  .nav-tabs-bottom {
    margin-bottom: 0;

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

      .nav-link {
        border-top-width: 0;
C
codecalm 已提交
445
        border-bottom: $card-border-width solid $card-border-color;
C
codecalm 已提交
446 447 448 449 450 451 452

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

C
codecalm 已提交
453
  .card {
C
codecalm 已提交
454
    margin: 0;
C
codecalm 已提交
455
    border-top-left-radius: 0;
C
codecalm 已提交
456 457
  }
}