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 | |
Marc Kupietz | 09b7575 | 2023-10-07 09:32:19 +0200 | [diff] [blame] | 19 | // Text that auto-fits its container |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 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; |
Marc Kupietz | 9c036a4 | 2024-05-14 13:17:25 +0200 | [diff] [blame^] | 28 | grid-template-rows: 100%; |
Christophe Dervieux | e1893ae | 2021-10-07 17:09:02 +0200 | [diff] [blame] | 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, video { |
| 42 | min-width: 0; |
| 43 | min-height: 0; |
| 44 | object-fit: contain; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | .reveal .r-vstack { |
| 49 | flex-direction: column; |
| 50 | align-items: center; |
| 51 | justify-content: center; |
| 52 | } |
| 53 | |
| 54 | .reveal .r-hstack { |
| 55 | flex-direction: row; |
| 56 | align-items: center; |
| 57 | justify-content: center; |
| 58 | } |
| 59 | |
| 60 | // Naming based on tailwindcss |
| 61 | .reveal .items-stretch { align-items: stretch; } |
| 62 | .reveal .items-start { align-items: flex-start; } |
| 63 | .reveal .items-center { align-items: center; } |
| 64 | .reveal .items-end { align-items: flex-end; } |
| 65 | |
| 66 | .reveal .justify-between { justify-content: space-between; } |
| 67 | .reveal .justify-around { justify-content: space-around; } |
| 68 | .reveal .justify-start { justify-content: flex-start; } |
| 69 | .reveal .justify-center { justify-content: center; } |
| 70 | .reveal .justify-end { justify-content: flex-end; } |