Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Mini Cart block - Fix the drawer content height to allow checkout but…
Browse files Browse the repository at this point in the history
…ton to show. (#8351)

* Add max-height to Mini Cart drawer.

By giving the Mini Cart contents a max height with the
-webkit-fill-available property, we can ensure that the browser chrome
is accounted for on mobile devices.

* Add `dvh` and keep `vh` as a fallback for height.

By adding `dvh`, we also account for non-webkit mobile browsers that
have the same hidden button issue.

See
#8351 (review)

Keeping `vh` as a fallback, along with `-webkit-fill-available` gives us
the widest range of support.
  • Loading branch information
danielwrobert authored Feb 1, 2023
1 parent bd89203 commit d935a6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions assets/js/blocks/mini-cart/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
.wp-block-woocommerce-mini-cart-contents {
box-sizing: border-box;
height: 100vh;
height: 100dvh;
max-height: -webkit-fill-available;
padding: 0;
justify-content: center;
}
Expand All @@ -98,6 +100,8 @@
.wp-block-woocommerce-empty-mini-cart-contents-block,
.wp-block-woocommerce-filled-mini-cart-contents-block {
height: 100vh;
height: 100dvh;
max-height: -webkit-fill-available;
display: flex;
flex-direction: column;
}
Expand Down

0 comments on commit d935a6b

Please sign in to comment.