FeaturePageSection.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <script>
  2. export default {
  3. props: ["image"],
  4. };
  5. </script>
  6. <template>
  7. <div class="FeaturePageSection">
  8. <div class="container">
  9. <figure v-if="image">
  10. <img :src="image" alt="" />
  11. </figure>
  12. <div>
  13. <h2>
  14. <slot name="title" />
  15. </h2>
  16. <p v-if="$slots.lead" class="lead">
  17. <slot name="lead" />
  18. </p>
  19. <slot name="list" />
  20. </div>
  21. </div>
  22. </div>
  23. </template>
  24. <style scoped>
  25. .FeaturePageSection {
  26. margin: 0 0 0.5em;
  27. padding: 0 24px;
  28. }
  29. .PageHeader + .FeaturePageSection {
  30. padding: 48px 24px 0;
  31. }
  32. .FeaturePageSection:last-child {
  33. padding: 0 24px 48px;
  34. }
  35. .FeaturePageSection + .FeaturePageSection {
  36. margin: 2em 0 0.5em;
  37. }
  38. .FeaturePageSection h2 {
  39. margin: 0 0 0.5em;
  40. font-size: 1.5rem;
  41. font-weight: 700;
  42. line-height: inherit;
  43. }
  44. .FeaturePageSection .lead {
  45. margin: 0.5em 0;
  46. font-style: italic;
  47. }
  48. @media (min-width: 640px) {
  49. .FeaturePageSection {
  50. padding: 0 48px;
  51. }
  52. .PageHeader + .FeaturePageSection {
  53. padding: 48px 48px 0;
  54. }
  55. .FeaturePageSection:last-child {
  56. padding: 0 48px 48px;
  57. }
  58. .FeaturePageSection + .FeaturePageSection {
  59. margin: 4em 0 0.5em;
  60. }
  61. .FeaturePageSection h2 {
  62. font-size: 1.85rem;
  63. }
  64. .FeaturePageSection .lead {
  65. font-size: 1.15rem;
  66. }
  67. }
  68. @media (min-width: 960px) {
  69. .FeaturePageSection {
  70. padding: 0 64px;
  71. }
  72. .PageHeader + .FeaturePageSection {
  73. padding: 64px 64px 0;
  74. }
  75. .FeaturePageSection:last-child {
  76. padding: 0 64px 64px;
  77. }
  78. }
  79. .FeaturePageSection .container {
  80. flex-direction: column;
  81. gap: 2rem;
  82. }
  83. @media (min-width: 640px) {
  84. .FeaturePageSection .container {
  85. flex-direction: row;
  86. align-items: flex-start;
  87. }
  88. .FeaturePageSection:nth-child(2n + 1) .container {
  89. flex-direction: row-reverse;
  90. }
  91. .FeaturePageSection .container > * {
  92. width: 50%;
  93. }
  94. }
  95. figure {
  96. padding: 2rem;
  97. border-radius: 8px;
  98. background-color: var(--vp-c-bg-alt);
  99. }
  100. </style>