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

Native basis

An <article>: title and summary over a cover picture, a facts <dl> (client, year, role, services), the brief, deliverables as a list, a gallery of <figure>s and a link to the next project.

Web Platform APIs

<article><dl><figure>Container queriesobject-fit

Classes

.mk-project-details.mk-project-details-head.mk-project-details-title.mk-project-details-summary.mk-project-details-cover.mk-project-details-facts.mk-project-details-brief.mk-project-details-deliverables.mk-project-details-gallery.mk-project-details-next

Data attributes

data-span="wide" / "tall" on gallery figures.

§Default

Title and summary over a cover, the facts (<dl>), the brief beside the deliverables (from 48rem), a dense gallery with wide and tall pictures (data-span) and the next project.

§CSS view file

/* -- Project Details (website · Company) ----------------------------------
   Presents one project's brief, scope, deliverables, and media - a cover, the facts, the story and a gallery, ending with the next project. */
@layer components {
  /* every box in the block measures border-box - the same on any page */
  :where(.mk-project-details, .mk-project-details *, .mk-project-details ::before, .mk-project-details ::after) { box-sizing: border-box; }
  .mk-project-details { container: mk-project-details / inline-size; display: grid; gap: 2.5rem; width: 100%; }
  .mk-project-details-head { display: grid; gap: 1rem; }
  .mk-project-details-title { margin: 0; font-size: clamp(2rem, 6cqi, 4rem); font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
  .mk-project-details-summary { margin: 0; max-width: 44rem; color: var(--muted-foreground); font-size: 1.125rem; line-height: 1.6; text-wrap: pretty; }
  .mk-project-details-cover { margin: 0; overflow: hidden; border-radius: var(--radius-xl);
    & img { display: block; width: 100%; aspect-ratio: 16 / 8; object-fit: cover; }
  }
  .mk-project-details-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
    gap: 1.5rem;
    margin: 0;
    padding-block: 1.5rem;
    border-block: 1px solid var(--border);
    & div { display: grid; gap: 0.25rem; }
    & dt { color: var(--muted-foreground); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
    & dd { margin: 0; font-weight: 500; }
  }
  .mk-project-details-brief { display: grid; gap: 2rem;
    & h2 { margin: 0 0 0.75rem; font-size: 1.25rem; font-weight: 600; }
    & p { margin: 0; color: var(--muted-foreground); line-height: 1.75; }
  }
  .mk-project-details-deliverables {
    margin: 0;
    padding: 0;
    list-style: none;
    border-block-start: 1px solid var(--border);
    & li { display: flex; justify-content: space-between; gap: 1rem; padding-block: 0.75rem; border-block-end: 1px solid var(--border); }
    & span { color: var(--muted-foreground); font-size: 0.875rem; }
  }
  .mk-project-details-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
    grid-auto-rows: 14rem;
    grid-auto-flow: dense;
    gap: 0.75rem;
    & figure { position: relative; margin: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--muted); }
    & img { display: block; width: 100%; height: 100%; object-fit: cover; }
    & figcaption { position: absolute; inset: auto 0.5rem 0.5rem; width: fit-content; padding: 0.25rem 0.625rem; border-radius: 999px; background: oklch(0.12 0.02 260 / 0.7); color: #fff; font-size: 0.75rem; backdrop-filter: blur(6px); }
    & [data-span="wide"] { grid-column: span 2; }
    & [data-span="tall"] { grid-row: span 2; }
  }
  .mk-project-details-next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 0;
    border-block-start: 1px solid var(--border);
    color: inherit;
    text-decoration: none;
    & small { display: block; color: var(--muted-foreground); font-size: 0.8125rem; }
    & strong { font-size: clamp(1.25rem, 3cqi, 2rem); font-weight: 600; letter-spacing: -0.02em; }
    & svg { width: 1.75rem; height: 1.75rem; transition: translate 200ms ease; }
    &:hover svg { translate: 0.375rem 0; }
    &:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-md); }
  }
  @container mk-project-details (min-width: 48rem) {
    .mk-project-details-brief { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 4rem; }
  }
  /* -- Accessibility ------------------------------------------- */
  @media (prefers-reduced-motion: reduce) {
    .mk-project-details-next svg { transition: none; }
    .mk-project-details-next:hover svg { translate: none; }
  }
  @media (forced-colors: active) {
    .mk-project-details-gallery figcaption { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  }
}

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