Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from Dec 22, 2023

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented Dec 21, 2023

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 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 added this to In progress (owned) ⏳ in WordPress Components via automation 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
Copy link
Member

@tyxla tyxla left a comment

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! 🚀

packages/components/CHANGELOG.md Outdated Show resolved Hide 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
Copy link

github-actions bot commented Dec 22, 2023

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
56 checks passed
WordPress Components automation moved this from In progress (owned) ⏳ to Done 🎉 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
45 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
Development

Successfully merging this pull request may close these issues.

None yet

2 participants