FeaturePageSection.vue 1.9 KB

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