summaryrefslogtreecommitdiff
path: root/_sass/common/components/_card.scss
blob: 2431461ef425edfcf281eb3e719ef9bd20527557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103

.card {
  max-width: 18rem;
  border-radius: map-get($base, border-radius);
  @include box-shadow();
  @include transition(box-shadow map-get($animation, duration) map-get($animation, timing-function));
  & > :first-child {
    border-top-left-radius: map-get($base, border-radius);
    border-top-right-radius: map-get($base, border-radius);
  }
  & > :last-child {
    border-bottom-right-radius: map-get($base, border-radius);
    border-bottom-left-radius: map-get($base, border-radius);
  }
}

.cell {
  & > .card {
    max-width: unset;
  }
}

.card__content {
  padding: map-get($spacers, 2) map-get($spacers, 3);
}

.card__header, .card__header > a {
  @include link-colors($text-color-d, $main-color-1);
}

.card__image {
  position: relative;
  width: 100%;
  & > img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
  }
  & > .overlay {
    position: absolute;
    width: 100%;
    max-height: 100%;
    padding: map-get($spacers, 2);
    a {
      text-decoration: none !important;
    }
  }
  & > .overlay, & > .overlay--top {
    top: 0;
    bottom: auto;
    border-top-left-radius: inherit;
    border-top-right-radius: inherit;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 0;
  }
  & > .overlay--bottom {
    top: auto;
    bottom: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: inherit;
    border-bottom-left-radius: inherit;
  }
  & > .overlay--full {
    top: 0;
    bottom: 0;
  }
  & > .overlay, & > .overlay--dark {
    @extend .text--dark;
    background-color: rgba(#000, .4);
  }
  & > .overlay--light {
    @extend .text--light;
    background: rgba(#fff, .4);
  }
}

.card--clickable {
  cursor: pointer;
  @include hover() {
    @include box-shadow(2);
    .card__image {
      & > img {
        height: inherit;
      }
    }
  }
  @include transition(map-get($clickable, transition));
}

.card--flat {
  @include box-shadow(0);
  .card__image {
    & > img {
      border-radius: map-get($base, border-radius);
    }
  }
  .card__content {
    padding-top: 0;
    padding-left: 0;
  }
}