Etch component

Hero 1

Page hero with a background image under a dark overlay, and a MAC Intro 1 on top: eyebrow, headline, lede and call-to-action buttons.

Hero 1

Copy Hero 1

Configurator settings

Change a setting in the configurator to include it.

Optional. Copies the component under its own name, such as News Card Alpha for a site.

Documentation

A page hero: a background image under a dark overlay, with a MAC Intro 1 on top (an eyebrow, a headline, a lede and two buttons). Use it as the first section of a page.

How to use it

  • Pick an Image from the media library. Without one, it shows a filler image.
  • Edit the MAC Intro 1 that the entry's Copy JSON brings in the content slot, or replace it. Its headline is an h1, and it's centered. Left empty, the slot shows nothing, so the hero shows only its image.
  • Place it on the page directly, not in a container: it's a section and spans the full width.

Good to know

  • Text inside it turns light (--text-light), and the eyebrow --primary-light, so both read well on the overlay.
  • The image is decorative (alt=""), so the text on top should say what matters.
  • The preview's Props tab tries the heights and the buttons (their size, and each one's style and outline). Copy the configured JSON once they're set.

CSS recipes

--mac-hero-1-min-height sets its height (the smaller of 80vh and 40rem), and --mac-hero-1-overlay the overlay's color (a dark neutral at 70%). A recipe changes every Hero 1 on the site: paste it in the site's main stylesheet, which Etch prints after the components' styles.

A brand overlay

For a hero in the brand's color: the photo under the primary's darkest shade.

/* The overlay in the primary's darkest shade */
.mac-hero-1 {
  --mac-hero-1-overlay: color-mix(in oklch, var(--primary-ultra-dark) 80%, transparent);
}

A darker overlay

For a busy or bright photo, so the text stays easy to read.

/* A darker overlay, for a busy or bright photo */
.mac-hero-1 {
  --mac-hero-1-overlay: color-mix(in oklch, var(--neutral-ultra-dark) 85%, transparent);
}

Reference

Read from the component's JSON, so it's always current.

Loading the reference