Theme
On this page (2)
Component Skill — components/event-description/component-skill.md

Native basis

Two columns from 52rem: the description (About, Who it is for as tags, What you will take away as a check list) and an <aside> card: a <dl> of facts, a <meter> for capacity and the action.

Built from

Button.

Web Platform APIs

<dl><meter>Container queriestext-wrap

Classes

.mk-event-description.mk-event-description-layout.mk-event-description-body.mk-event-description-audience.mk-event-description-takeaways.mk-event-description-facts.mk-event-description-capacity

Data attributes

None.

§Default

About, who it is for (tags), what you take away (a check list) beside a facts card - a <dl>, a <meter> for the seats left and the action; sticky from 52rem.

§CSS view file

/* -- Event Description (website · Events & Promotions) --------------------
   Explains an event's purpose, audience, and participation details - the story, who it is for, what you take away, and the practical facts. */
@layer components {
  /* every box in the block measures border-box - the same on any page */
  :where(.mk-event-description, .mk-event-description *, .mk-event-description ::before, .mk-event-description ::after) { box-sizing: border-box; }
  .mk-event-description { container: mk-event-description / inline-size; width: 100%; }
  .mk-event-description-layout { display: grid; gap: 2.5rem; }
  .mk-event-description-body { display: grid; gap: 2rem; min-width: 0;
    & section { display: grid; gap: 0.75rem; }
    & h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
    & p { margin: 0; color: var(--muted-foreground); line-height: 1.75; text-wrap: pretty; }
  }
  .mk-event-description-audience { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none;
    & li { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.375rem 0.75rem; border-radius: 999px; background: var(--muted); font-size: 0.875rem; font-weight: 500; }
    & svg { width: 0.875rem; height: 0.875rem; color: var(--primary); }
  }
  .mk-event-description-takeaways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 0.75rem 1.5rem; margin: 0; padding: 0; list-style: none;
    & li { display: flex; gap: 0.625rem; align-items: flex-start; line-height: 1.5; }
    & svg { flex: none; width: 1.125rem; height: 1.125rem; margin-block-start: 0.125rem; color: #16a34a; }
  }
  .mk-event-description-facts {
    display: grid;
    gap: 1.25rem;
    align-self: start;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--card);
    color: var(--card-foreground);
    & dl { display: grid; gap: 0.875rem; margin: 0; }
    & dl div { display: flex; justify-content: space-between; gap: 1rem; padding-block-end: 0.875rem; border-block-end: 1px solid var(--border); font-size: 0.9375rem; }
    & dt { color: var(--muted-foreground); }
    & dd { margin: 0; font-weight: 500; text-align: end; }
    & .btn { width: 100%; }
  }
  .mk-event-description-capacity { display: grid; gap: 0.375rem; font-size: 0.8125rem; color: var(--muted-foreground);
    & meter { width: 100%; height: 0.5rem; }
    & strong { color: var(--foreground); }
  }
  @container mk-event-description (min-width: 52rem) {
    .mk-event-description-layout { grid-template-columns: minmax(0, 1fr) 20rem; gap: 4rem; }
    .mk-event-description-facts { position: sticky; top: 1.5rem; }
  }
  /* -- Accessibility ------------------------------------------- */
  @media (forced-colors: active) {
    .mk-event-description-facts { border-color: CanvasText; }
  }
}

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