From 8d3d091ccba536bbd7105fcc7304bc1cf795e33d Mon Sep 17 00:00:00 2001 From: Andrew Serong <14988353+andrewserong@users.noreply.github.com> Date: Tue, 2 May 2023 12:35:20 +1000 Subject: [PATCH] Cover: Use overflow: clip, falling back to overflow: hidden --- packages/block-library/src/cover/style.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/cover/style.scss b/packages/block-library/src/cover/style.scss index 84a6c6978fad59..16c3293385a49a 100644 --- a/packages/block-library/src/cover/style.scss +++ b/packages/block-library/src/cover/style.scss @@ -8,8 +8,10 @@ align-items: center; padding: 1em; // Prevent the `wp-block-cover__background` span from overflowing the container when border-radius is applied. - // TODO: Find an alternative to `overflow: hidden` so that sticky elements can be used inside the cover block. + // `overflow: hidden` is provided as a fallback for browsers that don't support `overflow: clip`. overflow: hidden; + // Use clip instead of overflow: hidden so that sticky position works on child elements. + overflow: clip; // This block has customizable padding, border-box makes that more predictable. box-sizing: border-box; // Keep the flex layout direction to the physical direction (LTR) in RTL languages.