Skip to content

fix(layout): make page spacing consistent and fluid across pages - #179

Open
toto04 wants to merge 3 commits into
mainfrom
fix/consistent-page-spacing
Open

toto04 wants to merge 3 commits into
mainfrom
fix/consistent-page-spacing

Conversation

@toto04

@toto04 toto04 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

What

Unifies spacing across all existing pages with a small set of fluid spacing tokens, so the layout looks the same on every screen size instead of jumping at breakpoints.

Tokens (src/styles/globals.css)

Each value scales linearly between the 402px (mobile) and 1728px (desktop) Figma frames and is clamped outside that range:

Token Mobile → Desktop Used for
gutter 24 → 64px page side margins (also header and footer insets)
page-top 168 → 208px top offset below the fixed header
section 96 → 176px gap between sections and before the footer
block 40 → 72px gap between a section heading and its content

They work as regular spacing utilities (px-gutter, pt-page-top, gap-section, gap-block, ...).

Two helper utilities:

  • page-layout: for a page <main> (gutter + max width + top/bottom spacing)
  • page-container: for a single full-width section

Both cap content at 1440px through padding, not max-width. ShapeLayer clips horizontally to its section, so a max-width would cut the decorative shapes on wide screens.

Changes

  • Replaced the hard-coded per-page values (py-49/50/52/64, px-2/4/6/36, gap-20/24/38/60/75, md:mt-25.75, ...) with the tokens on every page: home, contact, collabora, faqs, associations, projects, matricole (+ guida), groups/guides landings, wizard, group/guide results, extra groups, 404.
  • Removed min-h-screen + vertical centering from content sections (projects, home About Us, associations, collabora, contact, faqs). It made spacing depend on the viewport height. Kept full height only where it is intended: home hero, wizard, Guida della Matricola, 404.
  • Hero title padding is now the same on all screen sizes (was py-4 mobile / py-14 from sm). Matricole uses the shared Hero. Groups and Guides landings use the same title styles.
  • On mobile, the wizard no longer adds an extra 16px inset on top of the page gutter.

Measurements

Measured with headless Chromium on 13 routes at 390 / 768 / 1280 / 1728px:

  • Title top: was 160–256px depending on the page. Now identical on every page at a given width.
  • Side margins: were 16 / 24 / 40px with no pattern. Now equal everywhere and aligned with the header.
  • Space before the footer: was 0–208px plus the footer's own margin. Now always section.
  • Horizontal overflow: none at any width.

Notes for review

  • Decorative shapes are positioned relative to each section's top. Where section heights changed (mostly Projects), they land in slightly different spots than in Figma.
  • Removed the This page is broken on mobile comment on Collabora. At 390px it now has correct margins and no overflow. Please restore it if it referred to something else.
  • Without a local backend I couldn't render wizard steps 2+ or the group results page. Those changes were checked in code only.

Introduce fluid spacing tokens in globals.css that scale linearly between
the 402px and 1728px Figma frames:

- gutter (24 → 64px): page side margins, header and footer insets
- page-top (168 → 208px): top offset below the fixed header
- section (96 → 176px): gap between page sections and before the footer
- block (40 → 72px): gap between a section heading and its content

Add `page-layout` / `page-container` utilities that cap content at 1440px
through padding instead of max-width, so section backgrounds and
ShapeLayers keep spanning the full viewport.

Apply them to every existing page, replacing the per-page values
(py-49/50/52/64, px-2/4/6/36, gap-20/24/38/60/75...). Drop
`min-h-screen` + vertical centering from content sections so spacing no
longer depends on the viewport height, use the shared Hero on Matricole,
and align the hero title padding across Hero, Groups and Guides.
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc0d6e86-56db-43ca-988e-762898be708a
📥 Commits

Reviewing files that changed from the base of the PR and between 0c3aee6 and a7a16b0.

📒 Files selected for processing: 21
  • src/app/associations/page.tsx
  • src/app/chi-siamo/page.tsx
  • src/app/contact/page.tsx
  • src/app/faqs/page.tsx
  • src/app/matricole/guida/page.tsx
  • src/app/matricole/page.tsx
  • src/app/page.tsx
  • src/app/projects/page.tsx
  • src/components/chi-siamo/answer-section.tsx
  • src/components/chi-siamo/history-section.tsx
  • src/components/chi-siamo/numbers-section.tsx
  • src/components/chi-siamo/path-section.tsx
  • src/components/chi-siamo/problem-section.tsx
  • src/components/chi-siamo/support-section.tsx
  • src/components/chi-siamo/vision-section.tsx
  • src/components/contact/collabora-section.tsx
  • src/components/footer/index.tsx
  • src/components/home/hero.tsx
  • src/components/home/materials.tsx
  • src/components/projects/upload.tsx
  • src/styles/globals.css
🚧 Files skipped from review as they are similar to previous changes: 8
  • src/components/footer/index.tsx
  • src/app/matricole/page.tsx
  • src/components/contact/collabora-section.tsx
  • src/app/associations/page.tsx
  • src/app/matricole/guida/page.tsx
  • src/components/home/materials.tsx
  • src/app/faqs/page.tsx
  • src/components/projects/upload.tsx

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

The change adds shared fluid spacing tokens and page layout utilities, then applies them across route shells, listing pages, and reusable sections. Several page wrappers and spacing classes change. Matricole intro now uses the shared Hero component.

Changes

Shared layout system

Layer / File(s) Summary
Add shared layout tokens
src/styles/globals.css
Adds fluid gutter, page-top, section, and block spacing tokens, a page-width cap, and page-container and page-layout utilities.
Apply layouts to route shells
src/app/*/page.tsx, src/app/not-found.tsx, src/components/wizard/wizard-shell.tsx
Route-level main elements adopt shared page layout and section spacing. Groups and guides pages adjust their wrappers; the wizard shell uses the shared page layout.
Update groups and guides result layouts
src/components/groups/*, src/components/guides/*
Groups and guides result views use nested content wrappers and shared page layouts. Existing conditional rendering remains, while breakpoint-specific margins are removed.
Update shared sections and site chrome
src/components/contact/*, src/components/faqs/faqs-tabs.tsx, src/components/footer/index.tsx, src/components/header/*, src/components/layout/*
Reusable text and contact sections replace fixed gaps and horizontal padding with shared spacing utilities. Header insets, footer spacing, and FAQ spacing also change.
Migrate home, matricole, and project sections
src/components/home/*, src/components/matricole/*, src/components/projects/*, src/components/chi-siamo/*
These sections adopt shared container and spacing utilities. Matricole intro uses the shared Hero component.

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: ⚪ Minimal · up to a7a16

No actionable merge-blocking risk was found in the layout migration.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 53 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: standardizing page spacing with fluid layout utilities across pages.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 50 functions across 53 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • 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.

toto04 and others added 2 commits October 15, 2026 15:04
* feat(chi-siamo): add "Su di noi" page

Implement the "Su di noi" Figma page at /chi-siamo, the route the header
already links to. The page is composed of existing components only
(CardIcon, Card primitives, Glass, GradientIcon, Button, Shape/ShapeLayer)
and uses the shared fluid spacing tokens (page-container, page-top,
gap-section, gap-block).

Sections: vision, problem, our answer, student path timeline, numbers,
history/structure links and 5x1000 support. Background shapes follow the
desktop Figma frame and are anchored per section; there is no mobile
frame yet, so mobile has no shapes.

* fix(chi-siamo): narrow the content column to the Figma width

Content spanned up to 1440px, leaving only the fluid gutter (~50-60px on
laptop screens) between it and the page edges. Override --container-page
on this page so page-container caps it at 1200px like in Figma (262px
margins on the 1728px frame).

Adapt the number cards to the narrower column: tighter padding, Figma's
unequal column proportions from xl, and the large icon only from 1xl, so
labels stay on two lines.

* style(chi-siamo): refine hierarchy cards and responsive layout

* style(chi-siamo): remove eyebrows and restore section hierarchy

---------

Co-authored-by: Bianca Roberta Ianosel <ianoselbiancaroberta02@gmail.com>
Conflicts resolved by keeping main's structure (shared animated background,
no per-page shapes; collabora rebuilt from Figma; Figma-tuned Hero title padding)
and reapplying this branch's fluid spacing tokens where they map mechanically
(main/page layouts, chi-siamo sections, home hero, footer).
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.

2 participants