fix(landing): docs layout fixes — sidebar, subnav, TOC, robots#143
Conversation
Only apply fixed positioning to sidebar when expanded (not collapsed). Fix mobile subnav to top and compensate TOC popover margin.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdjusts responsive CSS: desktop rule restricts fixed positioning of Changes
Sequence Diagram(s)(No sequence diagrams generated — changes are CSS-only layout adjustments without multi-component control flow.) Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
landing/src/styles/globals.css (2)
398-400: Avoid hard-coded TOC offset; derive it from a shared variable.Line 399 uses a fixed
3.5remcompensation. This can break when subnav height changes (density, font scaling, localization). Prefer a shared CSS variable used by both#nd-subnavheight and[data-toc-popover]offset.♻️ Suggested refactor
`@media` (max-width: 767px) { `#nd-subnav` { + --nd-subnav-height: 3.5rem; position: fixed !important; top: var(--fd-docs-row-1, 0px) !important; inset-inline-start: 0 !important; inset-inline-end: 0 !important; + min-height: var(--nd-subnav-height); } /* Compensate for fixed `#nd-subnav` leaving grid flow */ [data-toc-popover] { - margin-top: 3.5rem; + margin-top: var(--nd-subnav-height); } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@landing/src/styles/globals.css` around lines 398 - 400, Replace the hard-coded margin on the TOC popover with a shared CSS variable used by the subnav: introduce a custom property (e.g. --subnav-height) that's set where `#nd-subnav` defines its height and then use that variable inside the [data-toc-popover] rule instead of 3.5rem; update `#nd-subnav` to export the computed height to --subnav-height so both selectors reference the same value and the TOC offset adapts when subnav size changes.
378-380: Scopewill-changemore narrowly to avoid unnecessary layer promotion.Applying
will-change: transformunconditionally on desktop can add steady memory/compositing overhead even when no transform animation is active.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@landing/src/styles/globals.css` around lines 378 - 380, Remove the unconditional will-change from the `#nd-sidebar` rule and instead apply it only when a transform is actually needed (e.g., move the will-change: transform declaration into a transient class such as .is-transforming or .animate-transform applied to `#nd-sidebar` during animations/transitions); additionally scope that class rule behind prefers-reduced-motion: no-preference (or a pointer: fine media query) so layer promotion only happens when animations are permitted and active.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@landing/src/styles/globals.css`:
- Around line 398-400: Replace the hard-coded margin on the TOC popover with a
shared CSS variable used by the subnav: introduce a custom property (e.g.
--subnav-height) that's set where `#nd-subnav` defines its height and then use
that variable inside the [data-toc-popover] rule instead of 3.5rem; update
`#nd-subnav` to export the computed height to --subnav-height so both selectors
reference the same value and the TOC offset adapts when subnav size changes.
- Around line 378-380: Remove the unconditional will-change from the `#nd-sidebar`
rule and instead apply it only when a transform is actually needed (e.g., move
the will-change: transform declaration into a transient class such as
.is-transforming or .animate-transform applied to `#nd-sidebar` during
animations/transitions); additionally scope that class rule behind
prefers-reduced-motion: no-preference (or a pointer: fine media query) so layer
promotion only happens when animations are permitted and active.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6dcccd6a-2b9a-4282-887c-49f0e74576b5
📒 Files selected for processing (1)
landing/src/styles/globals.css
…ove unconditional will-change
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
landing/src/styles/globals.css (1)
385-397: Scope--subnav-heightwhere both selectors can read it.Line 387 defines
--subnav-heighton#nd-subnav, but Line 396 reads it from[data-toc-popover]. If they are not in a parent/child chain, the popover always falls back to3.5rem, which defeats dynamic compensation.♻️ Suggested adjustment
`@media` (max-width: 767px) { + :root { + --subnav-height: 3.5rem; + } + `#nd-subnav` { - --subnav-height: 3.5rem; position: fixed !important; top: var(--fd-docs-row-1, 0px) !important; inset-inline-start: 0 !important; inset-inline-end: 0 !important; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@landing/src/styles/globals.css` around lines 385 - 397, The CSS custom property --subnav-height is defined on `#nd-subnav` but read from [data-toc-popover], so when they aren’t in the same ancestor chain the popover falls back to 3.5rem; fix by defining the property on a common ancestor that contains both selectors (e.g., :root, html, or a shared container) inside the same `@media` (max-width: 767px) block so both `#nd-subnav` and [data-toc-popover] inherit the dynamic value (alternatively set the variable on both selectors) — update the media query to place --subnav-height on that shared scope rather than only on `#nd-subnav`.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@landing/src/styles/globals.css`:
- Around line 386-389: The CSS block for selector `#nd-subnav` violates the
stylelint rule declaration-empty-line-before; fix by adding a single empty line
before the declaration that begins with "position" inside the `#nd-subnav` rule
(or run your formatter/stylelint --fix), ensuring there is a blank line between
the custom property (--subnav-height: 3.5rem;) and the subsequent position:
fixed !important; declaration so the rule passes CI.
---
Nitpick comments:
In `@landing/src/styles/globals.css`:
- Around line 385-397: The CSS custom property --subnav-height is defined on
`#nd-subnav` but read from [data-toc-popover], so when they aren’t in the same
ancestor chain the popover falls back to 3.5rem; fix by defining the property on
a common ancestor that contains both selectors (e.g., :root, html, or a shared
container) inside the same `@media` (max-width: 767px) block so both `#nd-subnav`
and [data-toc-popover] inherit the dynamic value (alternatively set the variable
on both selectors) — update the media query to place --subnav-height on that
shared scope rather than only on `#nd-subnav`.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ec20e071-d374-4549-a59f-c9b191dd7ac8
📒 Files selected for processing (1)
landing/src/styles/globals.css
| #nd-subnav { | ||
| --subnav-height: 3.5rem; | ||
| position: fixed !important; | ||
| top: var(--fd-docs-row-1, 0px) !important; |
There was a problem hiding this comment.
Fix Stylelint spacing violation in #nd-subnav.
Line 388 currently violates declaration-empty-line-before. Please add the required empty line (or apply your formatter/linter autofix) so CI stays clean.
🧰 Tools
🪛 Stylelint (17.7.0)
[error] 388-388: Expected empty line before declaration (declaration-empty-line-before)
(declaration-empty-line-before)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@landing/src/styles/globals.css` around lines 386 - 389, The CSS block for
selector `#nd-subnav` violates the stylelint rule declaration-empty-line-before;
fix by adding a single empty line before the declaration that begins with
"position" inside the `#nd-subnav` rule (or run your formatter/stylelint --fix),
ensuring there is a blank line between the custom property (--subnav-height:
3.5rem;) and the subsequent position: fixed !important; declaration so the rule
passes CI.
Summary
Test plan
/_next/static/media/Summary by CodeRabbit