Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 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 it's 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 | } |
| 29 | |
| 30 | .reveal .r-stack > * { |
| 31 | grid-area: 1/1; |
| 32 | margin: auto; |
| 33 | } |
| 34 | |
| 35 | // Horizontal and vertical stacks |
| 36 | .reveal .r-vstack, |
| 37 | .reveal .r-hstack { |
| 38 | display: flex; |
| 39 | |
| 40 | img, video { |
| 41 | min-width: 0; |
| 42 | min-height: 0; |
| 43 | object-fit: contain; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | .reveal .r-vstack { |
| 48 | flex-direction: column; |
| 49 | align-items: center; |
| 50 | justify-content: center; |
| 51 | } |
| 52 | |
| 53 | .reveal .r-hstack { |
| 54 | flex-direction: row; |
| 55 | align-items: center; |
| 56 | justify-content: center; |
| 57 | } |
| 58 | |
| 59 | // Naming based on tailwindcss |
| 60 | .reveal .items-stretch { align-items: stretch; } |
| 61 | .reveal .items-start { align-items: flex-start; } |
| 62 | .reveal .items-center { align-items: center; } |
| 63 | .reveal .items-end { align-items: flex-end; } |
| 64 | |
| 65 | .reveal .justify-between { justify-content: space-between; } |
| 66 | .reveal .justify-around { justify-content: space-around; } |
| 67 | .reveal .justify-start { justify-content: flex-start; } |
| 68 | .reveal .justify-center { justify-content: center; } |
| 69 | .reveal .justify-end { justify-content: flex-end; } |