Top bar
Hairline-bottom bar with drawn wordmark, three quiet links, a star count, ghost and white pills; a rounded menu key opens a panel on phones.
Part of the style
Night Editor Chrome
7 parts that belong together, with their tokens, type and rules.
https://kitbash.me/components/night-editor-chrome/nav/figma.html?palette=bbecc5d76de4e25d
Use the Figma MCP server (https://mcp.figma.com/mcp). Download https://kitbash.me/components/night-editor-chrome/nav/figma.html?palette=bbecc5d76de4e25d and pass that whole HTML document to the html_to_figma tool, so the part "Top bar" lands as editable layers in my open Figma file. Fonts come from Google Fonts: if a face is missing in Figma, pick the closest one.
Code
<style>
/* Goes after the pack's base.css */
:root {
--paper: #959093;
--ink: #0e1217;
--ink-soft: rgba(14, 18, 23, 0.7);
--ink-mute: rgba(14, 18, 23, 0.45);
--ink-dark: #959093;
--surface: rgba(14, 18, 23, 0.05);
--surface-up: rgba(14, 18, 23, 0.08);
--surface-top: rgba(14, 18, 23, 0.14);
--line: rgba(14, 18, 23, 0.1);
--line-strong: rgba(14, 18, 23, 0.18);
--chrome: #8d888b;
--chrome-deep: #918c8f;
--sheet: #0e1217;
--sheet-ink: #867f83;
--sheet-line: #1a1f24;
--signal: #6c83a5;
--signal-deep: #77808e;
--select: #475771;
--ok: #3b4559;
}
</style>
<header class="nav">
<div class="nav__bar">
<a class="nav__logo" href="#" aria-label="Tidemark home">
<svg class="nav__mark" viewBox="0 0 28 28" width="28" height="28" aria-hidden="true">
<path d="M3 9.5c3.2-2.6 6.3-2.6 9.5 0s6.3 2.6 9.5 0" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round"/>
<path d="M3 17.5c3.2-2.6 6.3-2.6 9.5 0s6.3 2.6 9.5 0" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" opacity="0.45"/>
<circle cx="24.5" cy="22.5" r="2.5" fill="currentColor"/>
</svg>
<span class="nav__word">tidemark</span>
</a>
<nav class="nav__links" aria-label="Main">
<a class="nav__link" href="#">Guides</a>
<a class="nav__link" href="#">Plans</a>
<a class="nav__link" href="#">Changelog</a>
</nav>
<div class="nav__actions">
<a class="nav__meta" href="#">
<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><path d="M8 1.5l1.9 4 4.3.5-3.2 3 .9 4.3L8 11.1l-3.9 2.2.9-4.3-3.2-3 4.3-.5z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/></svg>
2.4k
</a>
<a class="nav__pill nav__pill--ghost" href="#">Log in</a>
<a class="nav__pill nav__pill--solid" href="#">Start writing</a>
</div>
<button class="nav__menu" type="button" aria-expanded="false" aria-label="Open menu">
<span class="nav__menu-lines" aria-hidden="true"></span>
</button>
</div>
<div class="nav__panel">
<div class="nav__panel-inner">
<a class="nav__panel-link" href="#">Guides</a>
<a class="nav__panel-link" href="#">Plans</a>
<a class="nav__panel-link" href="#">Changelog</a>
<a class="nav__panel-link" href="#">Community</a>
<div class="nav__panel-pills">
<a class="nav__pill nav__pill--ghost" href="#">Log in</a>
<a class="nav__pill nav__pill--solid" href="#">Start writing</a>
</div>
</div>
</div>
</header>
<style>
.nav {
position: sticky;
top: 0;
z-index: 20;
background: var(--paper);
border-bottom: var(--rule) solid var(--line);
}
.nav__bar {
display: flex;
align-items: center;
gap: var(--space-l);
height: var(--bar-height);
padding: 0 var(--edge);
}
.nav__logo {
display: inline-flex;
align-items: center;
gap: var(--space-s);
min-height: 44px;
color: var(--ink);
text-decoration: none;
}
.nav__word {
font-size: 22px;
font-weight: var(--weight-medium);
letter-spacing: -0.03em;
}
.nav__links {
display: flex;
gap: var(--space-xs);
}
.nav__link,
.nav__meta {
display: inline-flex;
align-items: center;
gap: 6px;
min-height: 44px;
padding: 0 10px;
color: var(--ink-soft);
font-size: 15px;
text-decoration: none;
transition: color var(--quick) var(--ease);
}
.nav__link:hover,
.nav__meta:hover,
.nav__link:focus-visible,
.nav__meta:focus-visible {
color: var(--ink);
}
.nav__actions {
display: flex;
align-items: center;
gap: var(--space-s);
margin-left: auto;
}
.nav__pill {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
height: 44px;
padding: 0 16px;
border: var(--rule) solid var(--line-strong);
border-radius: var(--radius-pill);
font-size: 15px;
text-decoration: none;
white-space: nowrap;
transition: background-color var(--quick) var(--ease), color var(--quick) var(--ease);
}
.nav__pill--ghost {
color: var(--ink);
}
.nav__pill--ghost:hover,
.nav__pill--ghost:focus-visible {
background: var(--surface-up);
}
.nav__pill--solid {
border-color: var(--ink);
background: var(--ink);
color: var(--ink-dark);
}
.nav__pill--solid:hover,
.nav__pill--solid:focus-visible {
background: var(--ink-soft);
}
.nav a:focus-visible,
.nav__menu:focus-visible {
outline: 2px solid var(--signal);
outline-offset: 2px;
}
.nav__menu {
display: none;
place-items: center;
width: 44px;
height: 44px;
margin-left: auto;
border: 0;
border-radius: var(--radius-chip);
background: var(--ink-soft);
cursor: pointer;
}
.nav__menu-lines,
.nav__menu-lines::before,
.nav__menu-lines::after {
display: block;
width: 18px;
height: 2px;
border-radius: 2px;
background: var(--ink-dark);
transition: transform var(--time) var(--ease), opacity var(--time) var(--ease);
}
.nav__menu-lines {
position: relative;
}
.nav__menu-lines::before,
.nav__menu-lines::after {
content: "";
position: absolute;
left: 0;
}
.nav__menu-lines::before { top: -6px; }
.nav__menu-lines::after { top: 6px; }
.nav.is-open .nav__menu-lines { background: transparent; }
.nav.is-open .nav__menu-lines::before { transform: translateY(6px) rotate(45deg); }
.nav.is-open .nav__menu-lines::after { transform: translateY(-6px) rotate(-45deg); }
.nav__panel {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows var(--time) var(--ease);
}
.nav__panel-inner {
overflow: hidden;
display: grid;
padding: 0 var(--edge);
}
.nav.is-open .nav__panel {
grid-template-rows: 1fr;
}
.nav.is-open .nav__panel-inner {
padding-bottom: var(--space-l);
}
.nav__panel-link {
display: flex;
align-items: center;
min-height: 52px;
border-bottom: var(--rule) solid var(--line);
color: var(--ink);
font-size: 20px;
font-weight: var(--weight-medium);
text-decoration: none;
}
.nav__panel-pills {
display: flex;
gap: var(--space-s);
padding-top: var(--space-l);
}
.nav__panel-pills .nav__pill {
flex: 1;
height: 44px;
}
@media (max-width: 860px) {
.nav__links,
.nav__actions {
display: none;
}
.nav__menu {
display: grid;
}
}
@media (min-width: 861px) {
.nav__panel {
display: none;
}
}
</style>
<script>
(() => {
for (const root of document.querySelectorAll('.nav')) {
const button = root.querySelector('.nav__menu');
if (!button) continue;
button.addEventListener('click', () => {
const open = root.classList.toggle('is-open');
button.setAttribute('aria-expanded', String(open));
button.setAttribute('aria-label', open ? 'Close menu' : 'Open menu');
});
}
})();
</script>