Skip to content

DropdownMenu V2: add fallback styles for when subgrid is not supported - #57327

Merged
ciampo merged 6 commits into
trunkfrom
fix/dropdown-menu-ariakit-fallback-subgrid
Dec 22, 2023
Merged

ciampo merged 6 commits into
trunkfrom
fix/dropdown-menu-ariakit-fallback-subgrid

Conversation

@ciampo

@ciampo ciampo commented Dec 21, 2023 •

Copy link
Copy Markdown
Contributor

What?

Add fallback styles to the experimental DropdownMenu v2 component for browsers that don't support CSS subgrid

Why?

As of today, there are still a few browsers with > 1% usage that don't support CSS subgrid (old safari versions, opera mobile, Samsung internet) that we should still support

How?

Add some fallback styles so that the menu items don't look broken in browsers that don't support CSS subgrid. The main difference is that the auto-indentation is not supported in those browsers.

Note: these are fallback styles that only a very small (and decreasing every day) percentage of folks are going to experience. The goal is to provide a non-broken experience, even if the overall look is not as refined as in modern browsers

Testing Instructions

To test what it's like to use the DropdownMenu component in an environment that doesn't support CSS subgrid:

  • use an older version of a web browser locally (ie. install Chrome 116), or;
  • use an older version of a web browser via a cloud service (ie. Browserstack), or;
  • manually delete from this PR the code inside @supports ( grid-template-columns: subgrid ) query

Test the DropdownMenu V2 Ariakit component both in Storybook and in the editor, on both a browser that doesn't support CSS subgrid and on one that supports it.

  • Make sure that the fallback layout works well enough
  • Make sure that the "standard" layout looks exactly like on trunk

Screenshots or screencast

In a browser with no CSS subgrid support (trunk) In a browser with no CSS subgrid support (This PR)
Screenshot 2023-12-22 at 00 11 57 Screenshot 2023-12-22 at 00 13 00

@ciampo
ciampo requested a review from ajitbohra as a code owner December 21, 2023 23:14
@ciampo ciampo self-assigned this Dec 21, 2023
@ciampo ciampo added [Type] Bug An existing feature does not function as intended [Package] Components /packages/components labels Dec 21, 2023
@ciampo
ciampo force-pushed the fix/dropdown-menu-ariakit-fallback-subgrid branch from 3bae143 to 3cf6d8e Compare December 22, 2023 08:47

@tyxla tyxla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works well and looks great! 🚀

Comment thread packages/components/CHANGELOG.md Resolved
@ciampo
ciampo force-pushed the fix/dropdown-menu-ariakit-fallback-subgrid branch from f2e2ed3 to 33b5f06 Compare December 22, 2023 10:43
@ciampo
ciampo enabled auto-merge (squash) December 22, 2023 10:44
@github-actions

github-actions Bot commented Dec 22, 2023 •

Copy link
Copy Markdown

Flaky tests detected in 33b5f06.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7298991546
📝 Reported issues:

@ciampo
ciampo merged commit ea21160 into trunk Dec 22, 2023
@ciampo
ciampo deleted the fix/dropdown-menu-ariakit-fallback-subgrid branch December 22, 2023 12:13
@github-actions github-actions Bot added this to the Gutenberg 17.4 milestone Dec 22, 2023
@ciampo ciampo mentioned this pull request Dec 22, 2023
43 of 58 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Components /packages/components [Type] Bug An existing feature does not function as intended

Projects

Status: Done 🎉

Development

Successfully merging this pull request may close these issues.

2 participants