SectionHeading.vue 1.34 KB
<script setup lang="ts">
defineProps<{
  kicker: string
  title: string
  description?: string
}>()
</script>

<template>
  <div class="section-heading">
    <div class="section-copy">
      <p class="section-kicker">{{ kicker }}</p>
      <h2 class="section-title">{{ title }}</h2>
      <p v-if="description" class="section-description">{{ description }}</p>
    </div>

    <div v-if="$slots.actions" class="section-actions">
      <slot name="actions" />
    </div>
  </div>
</template>

<style scoped>
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.section-copy {
  display: grid;
  gap: 10px;
}

.section-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 2.1vw, 38px);
  line-height: 1.06;
  color: var(--text-strong);
}

.section-description {
  margin: 0;
  max-width: 62ch;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

@media (max-width: 860px) {
  .section-heading {
    flex-direction: column;
  }

  .section-actions {
    justify-content: flex-start;
  }
}
</style>