Theme
On this page (6)
Component Skill — components/site-footer/component-skill.md

Native basis

<footer> content-info landmark; link columns are <ul>s in a grid; the social icons are labeled links. Everything wraps with container queries.

Web Platform APIs

<footer><nav aria-label>CSS Grid

Classes

.mk-footer.mk-footer-inner.mk-footer-nav.mk-footer-col.mk-footer-heading.mk-footer-list.mk-footer-rule.mk-footer-bottom.mk-footer-brand.mk-footer-brand-name.mk-footer-meta.mk-footer-social.mk-footer-copy

§Default

Four columns at wide widths; the rule is <hr class='separator'>.

§Simple

data-variant='simple': one row - brand, inline links (.mk-footer-links), copyright; it wraps when narrow. For apps and docs.

§About column and newsletter

.mk-footer-top: an about column - brand, a line, a newsletter field (.mk-footer-newsletter) and social links - beside three link columns; the bottom row carries a language Select (.mk-footer-locale).

§Dark with a call to action

data-variant='dark' inverts the footer; .mk-footer-cta puts a last call to action on top of it - a card glowing in the theme's chart colors.

§Wordmark

.mk-footer-wordmark: the brand name, huge and faint, closing the page - its size follows the footer width (container units).

§CSS view file

/* -- Site Footer (marketing) ---------------------------------------
   Link columns + rule + brand/social/copyright row. Named .mk-footer
   to avoid colliding with the doc site's own .site-footer chrome. */
@layer components {
  .mk-footer {
    container: mk-footer / inline-size;
    width: 100%;
    background: var(--background);
    color: var(--foreground);
  }
  .mk-footer-inner {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 80rem;
    margin-inline: auto;
    padding: 2.5rem 1.25rem;
  }
  .mk-footer-nav {
    display: grid;
    gap: 3rem;
  }
  .mk-footer-col { display: flex; flex-direction: column; gap: 0.625rem; }
  .mk-footer-heading {
    line-height: 1.3;
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 500;
  }
  .mk-footer-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 1rem;
    & a {
      display: flex;
      align-items: center;
      gap: 0.25rem;
      color: inherit;
      text-decoration: none;
      border-radius: var(--radius-sm);
      &:hover { text-decoration: underline; text-underline-offset: 3px; }
      &:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
    }
  }
  .mk-footer-rule { width: 100%; }
  .mk-footer-bottom { display: flex; flex-direction: column; gap: 2.25rem; }
  .mk-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    color: var(--primary);
    text-decoration: none;
    & svg { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
  }
  .mk-footer-brand-name { font-size: 0.875rem; font-weight: 500; white-space: nowrap; }
  .mk-footer-meta { display: flex; flex-direction: column; gap: 1rem; }
  .mk-footer-social {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted-foreground);
    & a { display: flex; color: inherit; border-radius: var(--radius-sm); &:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; } }
    & svg { width: 1rem; height: 1rem; }
  }
  .mk-footer-copy { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; }
  @container mk-footer (min-width: 30rem) {
    .mk-footer-nav { grid-template-columns: 1fr 1fr; }
    .mk-footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; }
    .mk-footer-meta { flex-direction: row; align-items: center; gap: 1rem; }
  }
  @container mk-footer (min-width: 52rem) {
    .mk-footer-inner { gap: 2.25rem; padding-inline: 2rem; }
    .mk-footer-nav { grid-template-columns: repeat(4, 1fr); gap: 2.25rem; }
  }
  /* -- variants ------------------------------------------------- */
  /* simple: one row - brand, inline links, copyright */
  .mk-footer[data-variant="simple"] .mk-footer-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-block: 1.5rem;
  }
  .mk-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    & a { color: var(--muted-foreground); text-decoration: none; border-radius: var(--radius-sm); }
    & a:hover { color: var(--foreground); }
    & a:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
  }
  /* top: an about column (brand, line, newsletter, social) beside the link columns */
  .mk-footer-top { display: grid; gap: 2.5rem; }
  .mk-footer-about {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    max-width: 24rem;
    & p { margin: 0; color: var(--muted-foreground); font-size: 0.875rem; text-wrap: pretty; }
  }
  .mk-footer-top .mk-footer-nav { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
  .mk-footer-newsletter {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    & .input { flex: 1; min-width: 0; }
  }
  .mk-footer-locale { display: flex; align-items: center; gap: 0.5rem; color: var(--muted-foreground); font-size: 0.875rem; }
  .mk-footer-locale .select { width: auto; height: 2rem; font-size: 0.8125rem; }
  /* dark: the footer inverts - the page ends on a dark band */
  .mk-footer[data-variant="dark"] {
    background: var(--foreground);
    color: var(--background);
    & :is(.mk-footer-heading, .mk-footer-copy, .mk-footer-social, .mk-footer-about p) { color: color-mix(in oklch, var(--background) 65%, transparent); }
    & .mk-footer-brand { color: inherit; }
    & .separator { background: color-mix(in oklch, var(--background) 18%, transparent); }
    & .mk-footer-list a:focus-visible { outline-color: var(--background); }
  }
  /* cta: a call to action on top of the footer */
  .mk-footer-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding: 2rem;
    border-radius: var(--radius-xl);
    background:
      radial-gradient(60% 120% at 100% 0%, color-mix(in oklch, var(--chart-1) 55%, transparent), transparent 70%), radial-gradient(50% 120% at 75% 100%, color-mix(in oklch, var(--chart-2) 40%, transparent), transparent 70%),
      color-mix(in oklch, var(--background) 8%, var(--foreground));
    color: var(--background);
    & h2 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
    & p { margin: 0.25rem 0 0; color: color-mix(in oklch, var(--background) 70%, transparent); }
    & .mk-footer-cta-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
  }
  .mk-footer:not([data-variant="dark"]) .mk-footer-cta { background: radial-gradient(60% 120% at 100% 0%, color-mix(in oklch, var(--chart-1) 55%, transparent), transparent 70%), radial-gradient(50% 120% at 75% 100%, color-mix(in oklch, var(--chart-2) 40%, transparent), transparent 70%), var(--foreground); }
  /* wordmark: the brand, huge, closing the page */
  .mk-footer-wordmark {
    margin: 0;
    overflow: hidden;
    color: color-mix(in oklch, currentColor 10%, transparent);
    font-size: 26cqi;
    font-weight: 800;
    line-height: 0.8;
    letter-spacing: -0.06em;
    text-align: center;
    white-space: nowrap;
    user-select: none;
  }
  @container mk-footer (min-width: 52rem) {
    .mk-footer-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 4rem; }
  }
  /* -- Accessibility ------------------------------------------- */
  @media (forced-colors: active) {
    .mk-footer[data-variant="dark"] { border-block-start: 1px solid CanvasText; }
    .mk-footer-cta { border: 1px solid CanvasText; }
    .mk-footer-wordmark { color: GrayText; }
  }
  @media (forced-colors: active) {
    .mk-footer-copy { color: CanvasText; }
  }
}

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