Etch component

Dialog 1

A dialog that shows a card's bio over the page. One per page serves every card.

Dialog 1

Copy Dialog 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 dialog that shows a card's bio over the page. One per page serves every card.

How to use it

  • Put one MAC Dialog 1 at the end of the site's main template, as MAC Lightbox 1. A card opens it when it has a bio, such as MAC Person Card 1 with its Bio slot filled.

Good to know

  • The dialog shows a copy of the bio the card keeps hidden, so the bio stays in the page's HTML. Close, Escape, the Back gesture on Android and a click outside it close it, and the focus goes back to the card.

CSS recipes

The CSS variables set its backdrop, ground, text color, width, padding, corners and fade. A recipe changes every Dialog 1 on the site: paste it in the site's main stylesheet, which Etch prints after the components' styles. MAC Lightbox 1 has the same looks for its viewer, so the two can match.

A light backdrop

For a light site, where a dark dim would feel heavy: the page fades to white behind the dialog.

/* A light backdrop, the panel framed by a faint line */
.mac-dialog-1 {
  --mac-dialog-1-backdrop: color-mix(in oklch, var(--white) 70%, transparent);
  border: var(--border);
}

A blurred page behind

For a busy page, so its text doesn't pull the eye from the dialog.

/* The page behind blurred a little */
.mac-dialog-1::backdrop {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

The blur costs phones some work while the dialog fades in.

Reference

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

Loading the reference