+234 Design System

Masthead

The top of every page. Replaces a 727 line Header that carries dropdown groups, a mobile menu, a search bar, a search overlay and a user menu.

Masthead with section nav under it

HTML
<header class="p234-masthead" style="position:static">
  <div class="p234-masthead__bar">
    <a class="p234-masthead__brand" href="#">
      <span class="p234-masthead__mark">+234</span>
      <span class="p234-masthead__tagline">Nigeria, in numbers and in context</span>
    </a>
    <nav class="p234-masthead__nav" aria-label="Main">
      <a href="#" aria-current="page">News</a>
      <a href="#">Markets</a>
      <a href="#">Cost of living</a>
      <a href="#">Elections</a>
      <a href="#">API</a>
    </nav>
    <div class="p234-masthead__actions">
      <button class="p234-masthead__icon" type="button" aria-label="Search">&#9906;</button>
      <button class="p234-masthead__icon" type="button" aria-label="Open menu">&#9776;</button>
      <a class="p234-btn p234-btn--secondary" href="#">Sign in</a>
    </div>
  </div>
  <nav class="p234-subnav" aria-label="Sections">
    <ul>
      <li><a href="#" aria-current="page">Top stories</a></li>
      <li><a href="#">Politics</a></li>
      <li><a href="#">Business</a></li>
      <li><a href="#">World</a></li>
      <li><a href="#">Sport</a></li>
      <li><a href="#">Entertainment</a></li>
    </ul>
  </nav>
</header>

What this component owns

The shape, the rules, the layering and the breakpoints. The dropdown and overlay behaviour stays in the app: this is CSS, not a menu engine.

Rules

Search

Search is an icon at phone and tablet widths and may expand to an inline field once there is room. Whichever it is, the control is a real <form> with a labelled input, so Enter works and a password manager is not confused by it.

The mobile menu

Built from <details> and <summary>, so it opens and closes without JavaScript and is keyboard operable for free. If the script never arrives the menu still works, which matters on the connections most of this audience is on.

Tokens this component reads

--p234-color-paper--p234-color-ink--p234-color-ink-muted--p234-color-brand--p234-color-paper-sunk--p234-type-ui-*--p234-type-caption-*--p234-z-sticky--p234-field-height--p234-layout-container--p234-layout-gutter--p234-border-heavy