Theme
On this page (3)
Component Skill — components/reset-request/component-skill.md

Native basis

A card with an icon, a title, one email Input (autocomplete="email") and submit, and a link back to sign in. data-variant="sent" shows the confirmation (role="status") with the address and a resend action.

Built from

Input, Label, Button.

Web Platform APIs

autocompleteConstraint validation

Classes

.mk-reset-request.mk-reset-request-head.mk-auth-field.mk-reset-request-row.mk-reset-request-foot.mk-reset-request-icon.mk-reset-request-back

Data attributes

data-variant="sent".

§Default

An icon, one email field (autocomplete="email") and submit, and the way back to sign in.

§Sent

data-variant='sent': the confirmation (role="status") - the same message whether or not the account exists - with an email-app button and resend.

§CSS view file

/* -- Reset Request (website · Account & States) ---------------------------
   Requests a password-reset link for an account - the email field, then the "check your inbox" state with a way to resend. */
@layer components {
  /* every box in the block measures border-box - the same on any page */
  :where(.mk-reset-request, .mk-reset-request *, .mk-reset-request ::before, .mk-reset-request ::after) { box-sizing: border-box; }
  .mk-reset-request {
    container: mk-reset-request / inline-size;
    display: grid;
    gap: 1.5rem;
    width: 100%;
    max-width: 24rem;
    margin-inline: auto;
    padding: 2rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--card);
    color: var(--card-foreground);
    box-shadow: var(--shadow-sm);
  }
  .mk-reset-request-head { display: grid; justify-items: center; gap: 0.5rem; text-align: center;
    & > svg { width: 2rem; height: 2rem; color: var(--primary); }
    & h1, & h2 { margin: 0.25rem 0 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
    & p { margin: 0; color: var(--muted-foreground); font-size: 0.9375rem; text-wrap: pretty; }
  }
  .mk-reset-request form { display: grid; gap: 1rem; }
  .mk-reset-request .mk-auth-field { display: grid; gap: 0.375rem; }
  .mk-reset-request-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.875rem;
    & a { color: var(--primary); font-weight: 500; text-decoration: none; }
    & a:hover { text-decoration: underline; text-underline-offset: 3px; }
  }
  .mk-reset-request-foot { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; text-align: center;
    & a { color: var(--primary); font-weight: 600; text-decoration: none; }
    & a:hover { text-decoration: underline; text-underline-offset: 3px; }
  }
  .mk-reset-request-icon { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--muted); color: var(--foreground);
    & svg { width: 1.375rem; height: 1.375rem; }
  }
  .mk-reset-request .btn { width: 100%; }
  .mk-reset-request-back { display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem; color: var(--muted-foreground); font-size: 0.875rem; text-decoration: none;
    & svg { width: 1rem; height: 1rem; }
    &:hover { color: var(--foreground); }
  }
  .mk-reset-request[data-variant="sent"] .mk-reset-request-icon { background: color-mix(in oklch, #16a34a 14%, transparent); color: #15803d; }
  /* -- Accessibility ------------------------------------------- */
  @media (forced-colors: active) {
    .mk-reset-request { border-color: CanvasText; }
  }
}

Comments, ideas or improvements? Edit this page's source on GitHub