aboutsummaryrefslogtreecommitdiffstats
path: root/src/css/imports/_utilities.css
blob: 01da910ff1858a5b6f0337009275a91e62033a0c (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
/*

   UTILITIES

*/

/* This is for fluid media that is embedded from third party sites like youtube, vimeo etc.
 * Wrap the outer element in aspect-ratio and then extend it with the desired ratio i.e
 * Make sure there are no height and width attributes on the embedded media.
 * Adapted from: https://github.com/suitcss/components-flex-embed
 *
 * Example:
 *
 * <div class="aspect-ratio aspect-ratio--16x9">
 *  <iframe class="aspect-ratio--object"></iframe>
 * </div>
 *
 * */

.aspect-ratio {
  height: 0;
  position: relative;
}

.aspect-ratio--16x9 { padding-bottom: 56.25%; }
.aspect-ratio--9x16 { padding-bottom: 177.77%; }

.aspect-ratio--4x3 {  padding-bottom: 75%; }
.aspect-ratio--3x4 {  padding-bottom: 133.33%; }

.aspect-ratio--6x4 {  padding-bottom: 66.6%; }
.aspect-ratio--4x6 {  padding-bottom: 150%; }

.aspect-ratio--8x5 {  padding-bottom: 62.5%; }
.aspect-ratio--5x8 {  padding-bottom: 160%; }

.aspect-ratio--7x5 {  padding-bottom: 71.42%; }
.aspect-ratio--5x7 {  padding-bottom: 140%; }

.aspect-ratio--1x1 {  padding-bottom: 100%; }

.aspect-ratio--object {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
}

.overflow-container {
  overflow-y: scroll;
}

.center {
  margin-right: auto;
  margin-left: auto;
}

.fade-bottom-light {
  position: relative;
}

.fade-bottom-light:after {

    content: "";
    position: absolute;
    z-index: 1;
    bottom: 0;
    left: 0;
    pointer-events: none;
    background-image: linear-gradient(to bottom, color(#F0F2F5 alpha(-100%)), var(--white) 90%);
    width: 100%;
    height: 3rem;
  }

.divider {
  box-shadow: inset 0 -4px 0 var(--grey-1);
}