Skip to content

fix(layer): animate menu toggle into a cross inside the header overlay - #1486

Merged
atinux merged 3 commits into
mainfrom
fix/menu-toggle-overlay-animation
Nov 17, 2026
Merged

atinux merged 3 commits into
mainfrom
fix/menu-toggle-overlay-animation

Conversation

@atinux

@atinux atinux commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Written by an AI agent on behalf of @atinux.

On mobile, tapping the menu button opens UHeader's overlay, and the overlay shows its own copy of the toggle. That copy appears when the menu is already open, so it showed the cross from its first frame: the lines never animated. The toggle you actually see after tapping didn't move at all.

What changed

  • IconMenuToggle.vue: the toggle waits two animation frames after mounting before it draws the cross. The overlay's copy now starts as three lines and transitions into the cross, matching nuxt/nuxt.com#2656.
  • Same timing as nuxt.com: 300ms with a little more overshoot (cubic-bezier(0.34,1.56,0.64,1), previously 400ms with 1.36). The transition is now turned off under prefers-reduced-motion.

Evidence

Docs dev server, 390×800 viewport. After clicking "Open menu", I read getComputedStyle(line).rotate on the overlay toggle's top line every frame.

Time after click main This branch
~100ms 45deg 0deg
~135ms 45deg 19.9deg
~200ms 45deg 43.1deg
~270ms 45deg 49.4deg (overshoot)
~400ms 45deg 45deg

On main the line sits at 45° from the first frame the overlay is rendered. On this branch it rotates from 0° and settles at 45° after about 400ms. Screenshots of the open and closed states look the same as before. eslint passes on the file. I didn't record a video, and I didn't check reduced motion in a browser.

I also tried CSS @starting-style instead of the two frames, but it didn't work when tested by hand, so it was reverted (d3c2cd2).

ELI5

The menu button turns from three lines into an X when you open the menu. On phones, the X you see sits on a new layer that pops up already set to "open", so it appeared as an X instead of animating into one. Now it starts as three lines and animates.

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docus Ready Ready Preview Nov 17, 2026 12:09pm UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/create-docus@1486
npm i https://pkg.pr.new/docus@1486

commit: d3c2cd2

@docus-bundle-report

docus-bundle-report Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Bundle size

Explore the comparison →

Client 795.9 kB $\color{green}\textsf{(-89 B, -0.0}\%\textsf{)}$ · Server 1.64 MB $\color{red}\textsf{(+118 B, +0.0}\%\textsf{)}$

Initial page load PR Δ
/en/:lang?/:slug(.) 281.2 kB −143 B (−0.1%)
/fr/:lang?/:slug(.) 281.2 kB −143 B (−0.1%)
/en/:lang? 271.9 kB −109 B (−0.0%)
/fr/:lang? 271.9 kB −109 B (−0.0%)
/sitemap.xml 259.0 kB −106 B (−0.0%)
Prerendered URL Initial load Δ HTML Δ
/en/essentials/components 304.2 kB
23.0 kB from components
−143 B (−0.0%)
route −143 B, components ±0 B
22.4 kB +32 B (+0.1%)
/en/getting-started/installation 289.3 kB
8.14 kB from components
−143 B (−0.0%)
route −143 B, components ±0 B
18.4 kB −13 B (−0.1%)
/en/essentials/images-embeds 330.0 kB
48.9 kB from components
−143 B (−0.0%)
route −143 B, components ±0 B
17.4 kB +4 B (+0.0%)
/en/essentials/code-blocks 297.1 kB
16.0 kB from components
−143 B (−0.0%)
route −143 B, components ±0 B
22.9 kB −2 B (−0.0%)
/en 492.9 kB
221.0 kB from components
−109 B (−0.0%)
route −109 B, components ±0 B
17.0 kB +6 B (+0.0%)
Largest changes in the server
Package or file Base PR Δ
content/database.compressed.mjs 149.3 kB 149.1 kB −190 B (−0.1%)

Brotli sizes. Changes under 100 B are left out of the tables. Initial page load counts the JavaScript and CSS a route loads before it renders. Prerendered URLs count the JavaScript and CSS their HTML preloads (module scripts, modulepreload and stylesheets, not prefetch), and the HTML document. Components are the lazy-loaded components the page rendered: its HTML preloads them, but its route's static imports don't reach them. Measured by nuxt-bundle-analyzer for d3c2cd2.

@atinux
atinux merged commit b3e81ba into main Nov 17, 2026
13 checks passed
@atinux
atinux deleted the fix/menu-toggle-overlay-animation branch November 17, 2026 13:31

This branch was successfully deployed

1 active deployment
Preview — d3c2cd25 Deployed Nov 17, 2026 by vercel[bot]
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