Files
pbakaus_impeccable/public/css/sub-pages.css
T
Paul Bakaus c4dc0feb23 Polish the site header based on user feedback
- Kill double underlines on nav items and brand: scope '.site-header a
  { text-decoration: none }' more specifically so the page-level 'a'
  rule in main.css can't bleed through
- Add an inline SVG logo mark next to the 'Impeccable' wordmark (reuses
  the favicon.svg glyph, inlined so Bun's HTML loader doesn't try to
  bundle '/favicon.svg' from a non-relative path)
- Add a subtle GitHub star pill (icon + 17k + small star) at the far
  right of the header; replaces the bare 'GitHub' nav text link
- Remove the duplicate .github-link floater from the hero on the landing
  page; the header pill is the single place for the stars signal now
- Mobile: stop nav items from wrapping mid-word; lower the breakpoint
  to 820px; enable horizontal scroll with a mask fade on the right;
  hide the 'Home' link on mobile (the brand is already the home link);
  hide the brand wordmark below 480px (logo glyph alone); hide the 17k
  label inside the github pill on mobile (keep the icon + star)
2026-04-08 09:03:13 -07:00

227 lines
4.8 KiB
CSS

/*
* impeccable.style — shared styles for sub-pages and the site-wide header
*
* Imported by all generated pages under /skills, /anti-patterns, /tutorials,
* and by the hand-authored pages (index, cheatsheet, gallery, privacy) via
* a direct <link> tag so they all share the same header + prose typography.
*/
@import "./tokens.css";
/* ============================================
BASE
============================================ */
html {
scroll-behavior: smooth;
}
body {
font-family: var(--font-body);
color: var(--color-ink);
background: var(--color-paper);
line-height: 1.6;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
a {
color: inherit;
text-decoration: none;
}
/* ============================================
SHARED SITE HEADER
============================================ */
.site-header {
position: sticky;
top: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--spacing-md);
padding: 14px clamp(var(--spacing-md), 4vw, var(--spacing-2xl));
background: color-mix(in oklch, var(--color-paper) 94%, transparent);
-webkit-backdrop-filter: saturate(1.4) blur(16px);
backdrop-filter: saturate(1.4) blur(16px);
border-bottom: 1px solid var(--color-mist);
}
/* Kill any inherited text-decoration from page-level `a` rules. */
.site-header a,
.site-header a:hover {
text-decoration: none;
text-decoration-thickness: 0;
}
.site-header-brand {
display: inline-flex;
align-items: center;
gap: 10px;
font-family: var(--font-display);
font-size: 1.25rem;
font-weight: 600;
letter-spacing: -0.01em;
color: var(--color-ink);
flex-shrink: 0;
transition: color var(--duration-fast) var(--ease-out);
}
.site-header-brand:hover {
color: var(--color-accent);
}
.site-header-brand-logo {
width: 26px;
height: 26px;
border-radius: 6px;
flex-shrink: 0;
}
.site-header-brand-name {
display: inline-block;
}
.site-header-right {
display: flex;
align-items: center;
gap: clamp(var(--spacing-sm), 2vw, var(--spacing-md));
min-width: 0;
}
.site-header-nav {
display: flex;
align-items: center;
gap: clamp(var(--spacing-sm), 2vw, var(--spacing-md));
font-family: var(--font-body);
font-size: 0.9375rem;
font-weight: 500;
min-width: 0;
}
.site-header-nav a {
position: relative;
display: inline-block;
white-space: nowrap;
color: var(--color-charcoal);
padding: 4px 0;
transition: color var(--duration-fast) var(--ease-out);
}
.site-header-nav a:hover {
color: var(--color-accent);
}
.site-header-nav a[aria-current="page"] {
color: var(--color-ink);
font-weight: 600;
}
.site-header-nav a[aria-current="page"]::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: -4px;
height: 2px;
background: var(--color-accent);
border-radius: 2px;
}
/* GitHub star pill — subtle, inviting nudge without shouting */
.site-header-github {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 10px 4px 8px;
border-radius: 99px;
background: var(--color-cream);
border: 1px solid var(--color-mist);
font-family: var(--font-mono);
font-size: 0.8125rem;
font-weight: 500;
color: var(--color-charcoal);
flex-shrink: 0;
transition:
background var(--duration-fast) var(--ease-out),
border-color var(--duration-fast) var(--ease-out),
color var(--duration-fast) var(--ease-out);
}
.site-header-github svg {
width: 14px;
height: 14px;
flex-shrink: 0;
}
.site-header-github:hover {
background: var(--color-paper);
border-color: var(--color-ink);
color: var(--color-ink);
}
.site-header-github-star {
color: #f59e0b;
width: 12px;
height: 12px;
flex-shrink: 0;
}
@media (max-width: 820px) {
.site-header {
padding: 12px var(--spacing-md);
gap: var(--spacing-sm);
}
.site-header-brand {
font-size: 1.0625rem;
}
.site-header-brand-logo {
width: 22px;
height: 22px;
}
.site-header-right {
gap: var(--spacing-sm);
}
.site-header-nav {
font-size: 0.8125rem;
gap: var(--spacing-sm);
overflow-x: auto;
scrollbar-width: none;
-webkit-overflow-scrolling: touch;
/* fade the right edge so users see there's more to scroll */
mask-image: linear-gradient(to right, black 0%, black calc(100% - 24px), transparent 100%);
-webkit-mask-image: linear-gradient(to right, black 0%, black calc(100% - 24px), transparent 100%);
}
.site-header-nav::-webkit-scrollbar {
display: none;
}
.site-header-nav a[data-nav="home"] {
/* Brand already acts as home link on mobile */
display: none;
}
.site-header-github {
padding: 4px 8px;
}
.site-header-github-label {
display: none;
}
}
@media (max-width: 480px) {
.site-header-brand-name {
/* Logo alone on narrow screens */
display: none;
}
}