Summary Files Commits Branches @commit @diff @stats
path: root / src / _media.scss
blob: 4029e4cdb7ec68191b961856b6a764c00d629566 (plain) (blame)
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
// Media
// Image responsive
.img-responsive {
  display: block;
  height: auto;
  max-width: 100%;
}

// object-fit support is coming to Microsoft Edge
// https://developer.microsoft.com/en-us/microsoft-edge/platform/status/objectfitandobjectposition/
.img-fit-cover {
  object-fit: cover;
}

.img-fit-contain {
  object-fit: contain;
}

// Video responsive
.video-responsive {
  display: block;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: 100%;
  &::before {
    content: "";
    display: block;
    padding-bottom: 56.25%; // Default ratio 16:9, you can calculate this value by dividing 9 by 16
  }

  iframe,
  object,
  embed {
    border: 0;
    bottom: 0;
    height: 100%;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
  }
}

video.video-responsive {
  height: auto;
  max-width: 100%;

  &::before {
    content: none;
  }
}

.video-responsive-4-3 {
  &::before {
    padding-bottom: 75%; // Ratio 4:3
  }
}

.video-responsive-1-1 {
  &::before {
    padding-bottom: 100%; // Ratio 1:1
  }
}

// Figure
.figure {
  margin: 0 0 $layout-spacing 0;

  .figure-caption {
    color: $gray-color-dark;
    margin-top: $layout-spacing;
  }
}