| 1 | /** |
| 2 | * Layout helpers. |
| 3 | */ |
| 4 | |
| 5 | // Stretch an element vertically based on available space |
| 6 | .reveal .stretch, |
| 7 | .reveal .r-stretch { |
| 8 | max-width: none; |
| 9 | max-height: none; |
| 10 | } |
| 11 | |
| 12 | .reveal pre.stretch code, |
| 13 | .reveal pre.r-stretch code { |
| 14 | height: 100%; |
| 15 | max-height: 100%; |
| 16 | box-sizing: border-box; |
| 17 | } |
| 18 | |
| 19 | // Text that auto-fits its container |
| 20 | .reveal .r-fit-text { |
| 21 | display: inline-block; // https://github.com/rikschennink/fitty#performance |
| 22 | white-space: nowrap; |
| 23 | } |
| 24 | |
| 25 | // Stack multiple elements on top of each other |
| 26 | .reveal .r-stack { |
| 27 | display: grid; |
| 28 | grid-template-rows: 100%; |
| 29 | } |
| 30 | |
| 31 | .reveal .r-stack > * { |
| 32 | grid-area: 1/1; |
| 33 | margin: auto; |
| 34 | } |
| 35 | |
| 36 | // Horizontal and vertical stacks |
| 37 | .reveal .r-vstack, |
| 38 | .reveal .r-hstack { |
| 39 | display: flex; |
| 40 | |
| 41 | img, |
| 42 | video { |
| 43 | min-width: 0; |
| 44 | min-height: 0; |
| 45 | object-fit: contain; |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | .reveal .r-vstack { |
| 50 | flex-direction: column; |
| 51 | align-items: center; |
| 52 | justify-content: center; |
| 53 | } |
| 54 | |
| 55 | .reveal .r-hstack { |
| 56 | flex-direction: row; |
| 57 | align-items: center; |
| 58 | justify-content: center; |
| 59 | } |
| 60 | |
| 61 | // Naming based on tailwindcss |
| 62 | .reveal .items-stretch { |
| 63 | align-items: stretch; |
| 64 | } |
| 65 | .reveal .items-start { |
| 66 | align-items: flex-start; |
| 67 | } |
| 68 | .reveal .items-center { |
| 69 | align-items: center; |
| 70 | } |
| 71 | .reveal .items-end { |
| 72 | align-items: flex-end; |
| 73 | } |
| 74 | |
| 75 | .reveal .justify-between { |
| 76 | justify-content: space-between; |
| 77 | } |
| 78 | .reveal .justify-around { |
| 79 | justify-content: space-around; |
| 80 | } |
| 81 | .reveal .justify-start { |
| 82 | justify-content: flex-start; |
| 83 | } |
| 84 | .reveal .justify-center { |
| 85 | justify-content: center; |
| 86 | } |
| 87 | .reveal .justify-end { |
| 88 | justify-content: flex-end; |
| 89 | } |
| 90 |