Skip to content

Anti-AI-slop design skill for Claude Code, Cursor, and Codex.

CSS

Fix · Almanac sticky section heads bleeding over the top nav

Youssefb41a3e60e2d5
diff --git a/site/css/components.css b/site/css/components.css
index d2edfe4..f9ea23d 100644
--- a/site/css/components.css
+++ b/site/css/components.css
@@ -24,15 +24,18 @@
}
/* — Banner (sticky top, thin, theme picker inline) ————————— */
+/* Uses --z-sticky-nav (above --z-sticky) so in-page sticky elements
+ like Almanac's .section__head dock BELOW the banner instead of
+ bleeding over it. Height stays in sync with --banner-height. */
.banner {
position: sticky;
top: 0;
- z-index: var(--z-sticky);
+ z-index: var(--z-sticky-nav);
display: flex;
align-items: center;
gap: var(--space-lg);
padding: 0 var(--page-gutter);
- height: 44px;
+ height: var(--banner-height);
background: color-mix(in oklch, var(--color-paper) 88%, transparent);
backdrop-filter: blur(14px) saturate(1.2);
-webkit-backdrop-filter: blur(14px) saturate(1.2);
diff --git a/site/css/sections.css b/site/css/sections.css
index e3b9869..1a7d8fc 100644
--- a/site/css/sections.css
+++ b/site/css/sections.css
@@ -1594,9 +1594,16 @@ html[data-theme="almanac"] body {
[data-theme="almanac"] .section__head {
position: sticky;
- top: 0;
+ /* Dock BELOW the .banner (sticky top:0, height: var(--banner-height)).
+ Both elements are sticky; without this offset, the section head bleeds
+ over the banner because both start at top:0. */
+ top: var(--banner-height);
+ /* --z-sticky (200) sits beneath --z-sticky-nav (300) so the banner
+ out-paints the section head even when their boxes overlap mid-scroll. */
z-index: var(--z-sticky);
background: var(--color-paper);
+ /* Solid paper background (no transparency) so the 12-column body grid
+ visible behind doesn't show through during the scroll transition. */
padding-block: var(--space-sm);
border-bottom: 1px solid var(--color-ink);
grid-template-columns: 1fr;
diff --git a/site/css/tokens.css b/site/css/tokens.css
index a49dd01..d122a87 100644
--- a/site/css/tokens.css
+++ b/site/css/tokens.css
@@ -98,13 +98,17 @@
--dur-short: 220ms;
--dur-long: 420ms;
- --z-base: 1;
- --z-raised: 10;
- --z-dropdown: 100;
- --z-sticky: 200;
- --z-modal: 400;
- --z-toast: 500;
- --z-tooltip: 600;
+ --z-base: 1;
+ --z-raised: 10;
+ --z-dropdown: 100;
+ --z-sticky: 200; /* in-page sticky elements (section heads, sidebars) */
+ --z-sticky-nav: 300; /* top nav / banner — must out-paint in-page sticky so docked section heads slide UNDER it */
+ --z-modal: 400;
+ --z-toast: 500;
+ --z-tooltip: 600;
+
+ /* Banner height — every in-page sticky element must offset by this so it docks BELOW the nav, never overlaps. */
+ --banner-height: 44px;
}
/* ──────────────────────────────────────────────────────────────
diff --git a/skill/SKILL.md b/skill/SKILL.md
index f3ce0ce..5635d5c 100644
--- a/skill/SKILL.md
+++ b/skill/SKILL.md
@@ -403,7 +403,7 @@ Before emitting any code, output a tight summary of what you're about to ship. T
- **Enrichment** · none (typography only)
- **Sections** · Hero · Logos · Stats · Features · Testimonials · Pricing · FAQ · CTA · Footer
- **Motion** · counter · pricing-lift · pulse-once
-- **Slop test** · 67 / 67 ✓ (run after Build)
+- **Slop test** · 68 / 68 ✓ (run after Build)
- **Diversification** · differs from Linen on display style + accent hue
```
@@ -414,7 +414,7 @@ Before emitting any code, output a tight summary of what you're about to ship. T
3. **Enrichment** — the chosen archetype + tier, or *none (typography only)*.
4. **Sections** — section names separated by ` · `, in DOM order.
5. **Motion** — microinteraction primitives separated by ` · `, or *none — typography only*. Always under three primitives per the [`microinteractions.md`](references/microinteractions.md) hard rules.
-6. **Slop test** — `67 / 67 ✓` if all gates pass, or `N / 67 — fails: <gate numbers>` if any are open. Run the slop test BEFORE writing this row; the slop test is Step 7.
+6. **Slop test** — `68 / 68 ✓` if all gates pass, or `N / 68 — fails: <gate numbers>` if any are open. Run the slop test BEFORE writing this row; the slop test is Step 7.
7. **Diversification** *(optional, only when `.hallmark/log.json` has prior entries)* — what axes differ vs the previous run.
**Then one quiet CTA line, italicised, after the bullets:**
@@ -453,7 +453,7 @@ Always:
### 7. The slop test
-Before handing back, run the output through the 67-gate slop test in [`references/slop-test.md`](references/slop-test.md). Every answer must be **no**. Load that file at this step (not earlier — it isn't needed until handoff). The active genre matters: some gates are universal, some are genre-scoped (atmospheric loosens the radial-bloom gate; modern-minimal loosens the zero-chroma neutral gate; etc.). The full per-genre overrides are listed inline in `slop-test.md`.
+Before handing back, run the output through the 68-gate slop test in [`references/slop-test.md`](references/slop-test.md). Every answer must be **no**. Load that file at this step (not earlier — it isn't needed until handoff). The active genre matters: some gates are universal, some are genre-scoped (atmospheric loosens the radial-bloom gate; modern-minimal loosens the zero-chroma neutral gate; etc.). The full per-genre overrides are listed inline in `slop-test.md`.
Run the slop test BEFORE writing the Slop test row in the Step 5 preview block — that row reflects the actual outcome of this step.
diff --git a/skill/references/components/f2-sticky-scroll-stack.md b/skill/references/components/f2-sticky-scroll-stack.md
index b36965a..321653b 100644
--- a/skill/references/components/f2-sticky-scroll-stack.md
+++ b/skill/references/components/f2-sticky-scroll-stack.md
@@ -13,5 +13,8 @@ Sticky left pane, scrolling right pane that cycles through related screenshots.
```
```css
.sticky-stack { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2xl); }
-.pane-sticky { position: sticky; top: var(--space-xl); align-self: start; }
+/* `calc(--banner-height + --space-xl)` so the sticky pane docks below the
+ nav with breathing room. Falls back to --space-xl alone when no sticky
+ nav is on the page (slop-test gate 68). */
+.pane-sticky { position: sticky; top: calc(var(--banner-height, 0px) + var(--space-xl)); align-self: start; z-index: var(--z-sticky); }
```
diff --git a/skill/references/components/s3-sticky-pinned.md b/skill/references/components/s3-sticky-pinned.md
index 77c68ec..faf02a7 100644
--- a/skill/references/components/s3-sticky-pinned.md
+++ b/skill/references/components/s3-sticky-pinned.md
@@ -10,5 +10,10 @@ Heading remains in viewport while content scrolls beneath. Orientation aid.
</header>
```
```css
-.head-sticky { position: sticky; top: 0; background: var(--color-paper); padding-block: var(--space-sm); border-bottom: 1px solid var(--color-ink); z-index: 10; }
+/* If the page has a sticky top nav, offset by its height so the sticky
+ head docks BENEATH it instead of bleeding over (slop-test gate 68).
+ Use --z-sticky (in-page) so the nav's --z-sticky-nav out-paints it. */
+.head-sticky { position: sticky; top: var(--banner-height, 0px); background: var(--color-paper); padding-block: var(--space-sm); border-bottom: 1px solid var(--color-ink); z-index: var(--z-sticky); }
```
+
+**Sticky pairing rule:** if the page emits a sticky `<header>` / `<nav>` / `.banner` (anything with `position: sticky; top: 0`), you MUST also declare `--banner-height` (a px value matching the nav's height) and `--z-sticky-nav` (≥ 1 above `--z-sticky`) in `tokens.css`. The S3 recipe above pulls both. Without those tokens the section head paints over the nav during scroll — see slop-test gate 68.
diff --git a/skill/references/preview-examples.md b/skill/references/preview-examples.md
index 88e68a2..4385562 100644
--- a/skill/references/preview-examples.md
+++ b/skill/references/preview-examples.md
@@ -12,7 +12,7 @@ Four sample Step 5 preview blocks for the model to imitate, varied across macros
> - **Enrichment** · Tier-B hand-built SVG (a 60-line coffee bean with `@property --rise` 6 s breathing-loop)
> - **Sections** · Masthead · Letter · Three Notes · Visit · Colophon
> - **Motion** · breathing-loop on bean only (respects `prefers-reduced-motion`)
-> - **Slop test** · 67 / 67 ✓
+> - **Slop test** · 68 / 68 ✓
> - **Diversification** · first run for this project
*Bento Grid (SaaS, motion-on):*
@@ -23,7 +23,7 @@ Four sample Step 5 preview blocks for the model to imitate, varied across macros
> - **Enrichment** · E1 Clipped-Edge Demo Video, Tier-A CSS-art trace waterfall
> - **Sections** · Hero · 6-tile Bento (stat · sparkline · quote · code · integrations · spotlight) · Index Footer
> - **Motion** · counter · pricing-lift · CSS marquee on integrations strip
-> - **Slop test** · 67 / 67 ✓
+> - **Slop test** · 68 / 68 ✓
> - **Diversification** · differs from Plain on paper hue (light-cool vs pure-white) + accent (indigo vs ink-blue)
*Manifesto (declarative, no enrichment):*
@@ -34,7 +34,7 @@ Four sample Step 5 preview blocks for the model to imitate, varied across macros
> - **Enrichment** · none (typography only — voice carries the brand)
> - **Sections** · Masthead · Title · Five Declarations · Bleed Band · What We Refuse · Working Rules · Practice · Reading · Colophon
> - **Motion** · none — typography only
-> - **Slop test** · 67 / 67 ✓
+> - **Slop test** · 68 / 68 ✓
> - **Diversification** · differs from Linen on paper band (dark vs light) + display style (display-heavy vs geometric-sans)
*Custom (Coffeebox archival café):*
@@ -45,5 +45,5 @@ Four sample Step 5 preview blocks for the model to imitate, varied across macros
> - **Enrichment** · Tier-A pure-CSS coffee bean (60-line SVG, breathing-loop optional)
> - **Sections** · Masthead · Letter · Three Notes · Visit · Colophon
> - **Motion** · breathing-loop on bean (with reduced-motion fallback)
-> - **Slop test** · 67 / 67 ✓
+> - **Slop test** · 68 / 68 ✓
> - **Diversification** · custom axes: light / italic-serif / chromatic-terracotta — differs from previous catalog Linen on accent hue + display style
diff --git a/skill/references/slop-test.md b/skill/references/slop-test.md
index b87394b..52877d1 100644
--- a/skill/references/slop-test.md
+++ b/skill/references/slop-test.md
@@ -194,7 +194,9 @@ Universal. Every emitted page must render flawlessly at 320 px, 375 px, 414 px,
67. **All-caps display heads with line-height < 1.0 → cap-collision on wrap.** Does any display-size element (`.hero__display`, `.section__title`, `h1`, `h2`, or anything `≥ --text-2xl`) declare both `text-transform: uppercase` AND a `line-height` (or `--lh-tight`) below `1.0`? If yes, fail. Uppercase glyphs have no descenders and their cap-tops sit at the very top of the line box — at `line-height: 0.94` (the old Manifesto / Sport / Brutal default) the cap-tops of line N+1 visibly collide with the baseline or commas of line N when the title wraps. The condensed display faces (Anton, Inter Tight 900, Bebas Neue) make this worse. **Floor for all-caps display heads is `line-height: 1.0`; recommended `1.02–1.08`.** Either bump `--lh-tight` ≥ 1.0 for the theme, or drop `text-transform: uppercase` on the display element. Most visible when a two-line `.section__title` wraps with a trailing comma on line one ("SAME PROMPT, TWO / DIFFERENT OUTPUTS.") — the comma + cap-D fuse into a single glyph blob.
-The CSS stamp at Step 6 records mobile pass alongside contrast: `· mobile: pass (36, 59, 61–67)`.
+68. **Sticky element at `top: 0` below a sticky page-level nav → bleed.** Does the artifact declare `position: sticky; top: 0;` on any element OTHER than the page's top-level nav / banner / header, when a sticky `<header>` / `<nav>` / `.banner` also exists at `top: 0` (i.e. there are two sticky-at-top-0 elements on the page)? Auto-fail. Both stick to the viewport top during scroll and overlap; the deeper-in-DOM element paints over the nav (visible as a "section header bleeding into the nav bar" glitch). Fix: define a `--banner-height` token (~44–64 px depending on nav design) and offset every secondary sticky to `top: var(--banner-height)`, so it docks **beneath** the nav. Also give the nav a higher z-index than in-page sticky elements — split `--z-sticky` (in-page, e.g. 200) from `--z-sticky-nav` (top nav, e.g. 300) so the nav always out-paints when sticky boxes momentarily overlap. This gate fires only when the page actually has sticky elements (S3 sticky-pinned section heads, F2 sticky-scroll feature stacks, sticky tables-of-contents); pages without sticky behaviour pass trivially.
+
+The CSS stamp at Step 6 records mobile pass alongside contrast: `· mobile: pass (36, 59, 61–68)`.
---