aboutsummaryrefslogtreecommitdiff
path: root/css/layout.scss
blob: 9f4d86d7e995f3f4bcedd9620722ab0170847349 (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
/**
 * Layout helpers.
 */

// Stretch an element vertically based on available space
.reveal .stretch,
.reveal .r-stretch {
	max-width: none;
	max-height: none;
}

.reveal pre.stretch code,
.reveal pre.r-stretch code {
	height: 100%;
	max-height: 100%;
	box-sizing: border-box;
}

// Text that auto-fits it's container
.reveal .r-fit-text {
	display: inline-block; // https://github.com/rikschennink/fitty#performance
	white-space: nowrap;
}

// Stack multiple elements on top of each other
.reveal .r-stack {
	display: grid;
}

.reveal .r-stack > * {
	grid-area: 1/1;
	margin: auto;
}

// Horizontal and vertical stacks
.reveal .r-vstack,
.reveal .r-hstack {
	display: flex;
}

.reveal .r-vstack {
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.reveal .r-hstack {
	flex-direction: row;
	align-items: center;
	justify-content: center;
}

// Naming based on tailwindcss
.reveal .items-stretch { align-items: stretch; }
.reveal .items-start { align-items: flex-start; }
.reveal .items-center { align-items: center; }
.reveal .items-end { align-items: flex-end; }

.reveal .justify-between { justify-content: space-between; }
.reveal .justify-around { justify-content: space-around; }
.reveal .justify-start { justify-content: flex-start; }
.reveal .justify-center { justify-content: center; }
.reveal .justify-end { justify-content: flex-end; }