layout.scss 1.4 KB

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