Skip to content

refactor: Improve templates layout flexibility#89245

Merged
bgw merged 2 commits intovercel:canaryfrom
alexcarpenter:alexcarpenter/template-layout-flexibility
Jan 29, 2026
Merged

refactor: Improve templates layout flexibility#89245
bgw merged 2 commits intovercel:canaryfrom
alexcarpenter:alexcarpenter/template-layout-flexibility

Conversation

@alexcarpenter
Copy link
Contributor

@alexcarpenter alexcarpenter commented Jan 29, 2026

What

Switches the create-next-app templates (app-tw, app) to flex-based layouts instead of min-height: 100vh.

Why

At Clerk, we ship a template on top of create-next-app that adds a header with sign-in/sign-up links to the root layout. The current min-height: 100vh approach causes overflow as soon as you add anything to the layout.

Here's a minimal repo showing the overflow issue.

Using flexbox lets the page fill remaining space naturally, so headers/footers don't force an overflow and avoids us having to modify the page.tsx template.

Changes

Tailwind (app-tw):

  • Layout: h-full on <html>, min-h-full flex flex-col on <body>
  • Page: min-h-screenflex flex-col flex-1

CSS Modules (app):

  • globals.css: height: 100% on html, min-height: 100%; display: flex; flex-direction: column on body
  • page.module.css: min-height: 100vhflex: 1

The empty templates (app-empty, app-tw-empty) don't have height styling so they're unchanged.

BEFORE AFTER
Screenshot 2026-01-29 at 9 41 58 AM Screenshot 2026-01-29 at 9 42 31 AM

Closes NEXT-
Fixes #

@nextjs-bot nextjs-bot added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Jan 29, 2026
@nextjs-bot
Copy link
Collaborator

nextjs-bot commented Jan 29, 2026

Allow CI Workflow Run

  • approve CI run for commit: fb93c8a

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@vercel vercel deleted a comment from nextjs-bot Jan 29, 2026
@bgw bgw enabled auto-merge (squash) January 29, 2026 22:08
@bgw
Copy link
Member

bgw commented Jan 29, 2026

Thanks! I'll work on getting this merged.

@bgw bgw merged commit 1565d63 into vercel:canary Jan 29, 2026
320 of 334 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

create-next-app Related to our CLI tool for quickly starting a new Next.js application. locked

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants