Skip to content

Add aa-menu variant for the main menu breakpoint - #9151

Open
senid231 wants to merge 2 commits into
activeadmin:masterfrom
senid231:menu-breakpoint-variant
Open

senid231 wants to merge 2 commits into
activeadmin:masterfrom
senid231:menu-breakpoint-variant

Conversation

@senid231

@senid231 senid231 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Adds an aa-menu variant to the Tailwind plugin and uses it instead of xl: for the main menu. Below that width the menu is a drawer, and from that width up it is a fixed side menu.

The variant defaults to @media (width >= 80rem), the same as xl. A host changes it in active_admin.css without copying any view:

@custom-variant aa-menu (@media (width >= 64rem));

@media not all keeps the drawer at every width, for themes that move navigation into the header.

I used addVariant rather than a screens entry, because a new screen also adds a step to .container's max width.

Part of #9146. The compiled CSS has the same rules as before, but the aa-menu rules sort after the built-in breakpoints. None of them conflicts with a later utility on the same element. The HTML differs only in the class names.

@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.11%. Comparing base (e1dad93) to head (a4c9ffc).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9151   +/-   ##
=======================================
  Coverage   99.11%   99.11%           
=======================================
  Files         139      139           
  Lines        4071     4071           
=======================================
  Hits         4035     4035           
  Misses         36       36           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The main menu switched from drawer to side menu at a hardcoded xl, so a
theme had to copy the layout, header and navigation to change it. The
variant defaults to the same 80rem, and a host redeclares it in CSS.

Co-Authored-By: Clanker
@senid231
senid231 force-pushed the menu-breakpoint-variant branch from 1004705 to c4629de Compare November 12, 2026 11:20
@senid231

Copy link
Copy Markdown
Contributor Author

CI failed only in the test (3.4, rails_72) job (https://github.com/activeadmin/activeadmin/actions/runs/43208301172/job/131149002695). Headless Chrome on the runner timed out (Browser did not produce websocket url within 30 seconds, Timed out waiting for a response to Target.createTarget), so a few cucumber scenarios failed while opening a page. The other test jobs and all RSpec examples passed.

Could a maintainer re-run the failed job? I don't have permission to.

The docs already show the override example, so the plugin comment
keeps one line.

Co-Authored-By: Clanker
@senid231
senid231 force-pushed the menu-breakpoint-variant branch from c4629de to a4c9ffc Compare November 13, 2026 08:31

This branch has not been deployed

No deployments
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