Theme
Design your own
On this page (3)
Component Skill — components/maintenance/component-skill.md

Native basis

A <section role="status">: an icon, the title, an explanation, the expected end as <time>, an indeterminate <progress>, a status-page link and contact. The banner variant is one line for the app header.

Built from

Progress, Button.

Web Platform APIs

<time><progress>prefers-reduced-motion

Classes

.mk-maintenance.mk-maintenance-icon.mk-maintenance-title.mk-maintenance-text.mk-maintenance-eta.mk-maintenance-links

Data attributes

data-variant="banner".

§Default

role="status": a wrench that turns now and then (still under reduced motion), what is happening, the expected end as <time> with the time zone, an indeterminate <progress> and where to follow.

§Banner

data-variant='banner': one amber line in the app announcing the planned window.

§CSS view file

/* -- Maintenance (website · Account & States) -----------------------------
   Explains temporary unavailability and provides status information - what is happening, when it ends, and where to follow; or a banner announcing it. */
@layer components {
  /* every box in the block measures border-box - the same on any page */
  :where(.mk-maintenance, .mk-maintenance *, .mk-maintenance ::before, .mk-maintenance ::after) {
    box-sizing: border-box;
  }
  .mk-maintenance {
    display: grid;
    justify-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 32rem;
    margin-inline: auto;
    padding: 3rem 1.5rem;
    text-align: center;
  }
  .mk-maintenance-icon {
    display: grid;
    place-items: center;
    width: 4rem;
    height: 4rem;
    border-radius: var(--radius-xl);
    background: color-mix(in oklch, #d97706 15%, transparent);
    color: #b45309;
    & svg {
      width: 1.75rem;
      height: 1.75rem;
      animation: mk-maintenance-turn 4s ease-in-out infinite;
    }
  }
  @keyframes mk-maintenance-turn {
    0%,
    60%,
    100% {
      rotate: 0deg;
    }
    70% {
      rotate: -25deg;
    }
    85% {
      rotate: 15deg;
    }
  }
  .mk-maintenance-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }
  .mk-maintenance-text {
    margin: 0;
    color: var(--muted-foreground);
    line-height: 1.6;
    text-wrap: pretty;
  }
  .mk-maintenance-eta {
    display: grid;
    gap: 0.5rem;
    width: 100%;
    max-width: 20rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: var(--muted);
    font-size: 0.875rem;
    & strong {
      font-size: 1rem;
    }
    & progress {
      width: 100%;
      height: 0.375rem;
    }
  }
  .mk-maintenance-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .mk-maintenance[data-variant="banner"] {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.375rem 0.75rem;
    max-width: none;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-lg);
    background: color-mix(in oklch, #d97706 12%, transparent);
    color: #92400e;
    font-size: 0.875rem;
    text-align: center;
    & .mk-maintenance-icon {
      width: auto;
      height: auto;
      background: none;
      & svg {
        width: 1rem;
        height: 1rem;
        animation: none;
      }
    }
    & .mk-maintenance-text {
      color: inherit;
    }
    & a {
      color: inherit;
      font-weight: 600;
    }
  }
  /* -- Accessibility ------------------------------------------- */
  @media (prefers-reduced-motion: reduce) {
    .mk-maintenance-icon svg {
      animation: none;
    }
  }
  @media (forced-colors: active) {
    .mk-maintenance-icon,
    .mk-maintenance[data-variant="banner"] {
      border: 1px solid CanvasText;
    }
  }
}

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