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

Fix horizontal scrolling on pages including Streamfield ImageText block #12444

Merged

Conversation

ramram-mf
Copy link
Collaborator

@ramram-mf ramram-mf commented Jun 6, 2024

Description

The Image Text block, specifically the .image_text-block .streamfield-content .tw-row elements, when rendered on mobile viewports, calculates differently horizontal margins adhering to tailwind unit scales, having 16px to each side, providing the following box model:
image

This PR attempts to mitigate the resulting user experience behavior in mobile devices, which introduces horizontal body wide scrolling. This horizontal scrolling gets in the way of vertical scrolling and immediately disrupts user experience in affected pages.

The solution proposed uses a calc() css function to remove the resulting extra 1px from the right of the elements so it doesn't overflow from body.

image

Fix will only be applied to small viewports.
image

Link to sample test page: https://foundation-s-tp1-168-st-l8zo7d.herokuapp.com/en/initiatives/web-literacy/core-curriculum/participate/
Related PRs/issues: #10801

┆Issue is synchronized with this Jira Story

@ramram-mf ramram-mf temporarily deployed to foundation-s-tp1-168-st-htmmlc June 6, 2024 15:45 Inactive
@ramram-mf ramram-mf changed the title Fixed autocomplete UI styling for dark mode Fix horizontal scrolling on pages including Streamfield ImageText block Jun 6, 2024
@ramram-mf ramram-mf temporarily deployed to foundation-s-tp1-168-st-l8zo7d June 6, 2024 18:09 Inactive
@ramram-mf ramram-mf requested a review from robdivincenzo June 6, 2024 18:48
Copy link
Collaborator

@robdivincenzo robdivincenzo left a comment

Choose a reason for hiding this comment

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

Great job @ramram-mf, the new rule addresses the issue and the horizontal scroll is no more! I left one small comment on adjusting the implementation. Please reach out if you have any questions!

source/sass/wagtail/blocks.scss Outdated Show resolved Hide resolved
@ramram-mf ramram-mf temporarily deployed to foundation-s-tp1-168-st-l8zo7d June 7, 2024 02:25 Inactive
@ramram-mf ramram-mf temporarily deployed to foundation-s-tp1-168-st-l8zo7d June 7, 2024 02:35 Inactive
@ramram-mf ramram-mf self-assigned this Jun 10, 2024
@ramram-mf ramram-mf temporarily deployed to foundation-s-tp1-168-st-l8zo7d June 10, 2024 23:16 Inactive
@ramram-mf ramram-mf requested a review from robdivincenzo June 10, 2024 23:29
…difying medium and large screens current margins.
…-on' of github-mf:MozillaFoundation/foundation.mozilla.org into TP1-168-strange-horizontal-panning-on-opportunity-pages-on
@ramram-mf ramram-mf temporarily deployed to foundation-s-tp1-168-st-l8zo7d June 12, 2024 20:25 Inactive
Copy link
Collaborator

@robdivincenzo robdivincenzo left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @ramram-mf! 🚀

@ramram-mf ramram-mf merged commit aeaa4b9 into main Jun 13, 2024
7 checks passed
@data-sync-user
Copy link
Collaborator

➤ Simon Acosta Torres commented:

PR has been merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants