Zoeken...  ⌘K GitHub

HeadingHighlight heading

Koptitel met gemarkeerd sleutelwoord via <mark>.

/heading-highlight
src/components/heading/HeadingHighlight.astro
---
interface Props {
  before?: string;
  highlight: string;
  after?: string;
  sub?: string;
}
const { before = "Wij leveren", highlight = "aantoonbare groei", after = "voor jouw bedrijf.", sub = "Geen vage beloften — alleen concrete resultaten die je terugziet in je omzetcijfers." } = Astro.props;
---

<div class="hd-highlight">
  <h2 class="hd-highlight__title">
    {before && <span>{before} </span>}
    <mark class="hd-highlight__mark">{highlight}</mark>
    {after && <span> {after}</span>}
  </h2>
  {sub && <p class="hd-highlight__sub">{sub}</p>}
</div>

<style>
  :root {
    --color-accent: #6366f1;
    --color-primary: #0a0a0a;
  }
  .hd-highlight {
    padding: 2.5rem 0;
    max-width: 720px;
  }
  .hd-highlight__title {
    margin: 0 0 1rem;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
  }
  .hd-highlight__mark {
    background: linear-gradient(to bottom, transparent 55%, rgba(99, 102, 241, 0.25) 55%);
    color: inherit;
    padding: 0 0.1em;
  }
  .hd-highlight__sub {
    margin: 0;
    font-size: 1.05rem;
    color: #555;
    line-height: 1.65;
  }
</style>

Props

Prop Type Default Beschrijving
before string Tekst vóór het gemarkeerde woord
highlight * string Gemarkeerde sleuteltekst
after string Tekst ná het gemarkeerde woord
sub string Subtekst

* = verplicht