Skip to content

fix(template): keep sidenotes clear of a following wide figure - #42

Merged
Zach Dunn (zachdunn) merged 1 commit into
claude/diagram-style-refinement-eb073efrom
claude/friendly-kilby-f04c3f
Oct 16, 2026
Merged

Zach Dunn (zachdunn) merged 1 commit into
claude/diagram-style-refinement-eb073efrom
claude/friendly-kilby-f04c3f

Conversation

@zachdunn

Copy link
Copy Markdown
Member

Stacked on #41.

At wide viewports a .sidenote sits in the right margin, running down from its paragraph's last line. When a wide figure comes right after that paragraph, the note ran into the figure's side margin. #41 puts the anatomy figures' margin notes there, so the overlap now shows (Fig. 2 of the walkthrough post: the "Include mini-map" note over the figure's right-hand notes).

The fix, in the template's wide-viewport media query:

:has(> .sidenote):has(+ .wide) > .sidenote { top: auto; bottom: 0; }

When a .wide element follows the paragraph, the note's bottom is anchored to the paragraph's bottom, so it ends level with the last line instead of starting there. Sidenotes before anything else behave as before. The rule holds in both styles and doesn't change phone widths, where the note stays a block under its paragraph.

The CSS is copied into the four example posts (on top of #41's versions) and assets/components.html.

Walkthrough post, Fig. 2 at 1280px: the sidenote ends level with the paragraph, above the figure's margin notes

The ↠before the note in the screenshot comes from serving the post fragment locally without a charset. The published page renders ←.

Checked

  • npm test: 121 of 121 pass.
  • At 1280px, in a headless browser, no sidenote overlaps a wide element, figure or heading in any example post or in the template.
  • At 390px the note is a static block inside its paragraph, with no horizontal scroll.

Known limit: a very short paragraph with a long sidenote before a wide figure pushes the note up past the paragraph's top. None of the examples has this.

…e element follows

A sidenote sits in the right margin from its paragraph's last line down, so
before a wide figure it ran into the figure's margin, where anatomy figures
now draw their margin notes. When the paragraph is followed by a .wide
element, anchor the note's bottom to the paragraph's bottom instead. Copied
into the example posts and the components page.
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 2
  • coderabbit:review
  • review
🚫 Excluded labels (none allowed): 1
  • wip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 037f5947-61d7-477e-8c3c-32d59fec3481

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@uploads-sh

uploads-sh Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

1 file · View all on uploads.sh →

walkthrough-ch2-1280-stacked3-2026-10-16T02-37-49-310Z.webp

Maintained by uploads.sh · add media: uploads put <file> --pr 42 · docs

@zachdunn
Zach Dunn (zachdunn) added this pull request to stack #43 October 16, 2026 02:38
@zachdunn
Zach Dunn (zachdunn) merged commit 8adc65c into main Oct 16, 2026
3 checks passed
@zachdunn
Zach Dunn (zachdunn) deleted the claude/friendly-kilby-f04c3f branch October 16, 2026 02:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant