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

Remove unwanted gaps between hero and footer when using dark sections #11862

Merged
merged 13 commits into from
Feb 16, 2024

Conversation

robdivincenzo
Copy link
Collaborator

@robdivincenzo robdivincenzo commented Feb 13, 2024

Description

The problem is that Issue #11756 introduced unwanted white gaps in between the dark hero and an immediately following dark section as seen by screenshots in Issue #11795 . Additionally, there is an unwanted white gap between the body section and the footer when the page ends with a dark section.

The solution is to conditionally add spacing above a paragraph block when it immediately follows a dark hero instead of after the dark hero unconditionally. The solution for the second unwanted white gap is to simply remove the margin class from the mozfest-content wrapper.

The implementation introduces a streamfield custom block which will be overridden to include a new streamfield_spacer.html template on mozfest_homepage.html and mozfest_landing_page.html templates. This new template extends the existing streamfield.html template to include a new body_spacer custom block containing a spacer div. The body_spacer block will then be rendered only if a paragraph is the first block in the body section. The body_spacer block is empty by default, meaning the spacer div is only rendered when the two following conditions are met:

  1. Mozfest Homepage or Mozfest Landing Page
  2. First block in body is a paragraph

There are further considerations. We could reduce coupling by adding margins to the paragraph block unconditionally to have adequate spacing in all cases regardless of placement. But the paragraph block is used generically and currently assumes spacing from blocks above it (see for example the various uses on just this one page: https://www.mozillafestival.org/en/highlights/). Modifying each dependency in order to introduce a generic paragraph margin seems out of scope for this issue, but perhaps could be a larger follow-up issue.

Link to sample test page: https://mozfest-foundation-s-issue-1179-lpznkg.mofostaging.net/en/test-landing/
Related PRs/issues: #11756 and #11795

Steps to test

  1. Review the dark section example page to confirm the white spaces are removed: https://mozfest-foundation-s-issue-1179-lpznkg.mofostaging.net/en/test-landing/
  2. Review the landing page example page to confirm the margin / spacer div is present above the first paragraph block and below the hero: https://mozfest-foundation-s-issue-1179-lpznkg.mofostaging.net/en/landing-page-1/
  3. Review another page to confirm the spacing is still accurate / untouched: https://mozfest-foundation-s-issue-1179-lpznkg.mofostaging.net/en/tickets/

@robdivincenzo robdivincenzo temporarily deployed to foundation-s-issue-1179-lpznkg February 14, 2024 18:29 Inactive
Copy link
Contributor

@jhonatan-lopes jhonatan-lopes left a comment

Choose a reason for hiding this comment

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

Thanks for taking on this work, @robdivincenzo! I think it's almost there, we just need to adjust the paragraph spacing

@robdivincenzo robdivincenzo temporarily deployed to foundation-s-issue-1179-lpznkg February 16, 2024 13:24 Inactive
@robdivincenzo robdivincenzo temporarily deployed to foundation-s-issue-1179-lpznkg February 16, 2024 13:54 Inactive
Copy link
Contributor

@jhonatan-lopes jhonatan-lopes 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 Rob!

@robdivincenzo robdivincenzo temporarily deployed to foundation-s-issue-1179-lpznkg February 16, 2024 18:18 Inactive
@robdivincenzo robdivincenzo merged commit d7ab180 into main Feb 16, 2024
6 checks passed
robdivincenzo added a commit that referenced this pull request May 23, 2024
robdivincenzo added a commit that referenced this pull request May 24, 2024
robdivincenzo added a commit that referenced this pull request Jun 4, 2024
* Remove extra spacing from image feature block

* Remove extra spacing from carousel text block

* Remove auto paragraph spacer portion of #11862, opting for manual spacer blocks instead

---------

Co-authored-by: Daniel Miranda <[email protected]>
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.

2 participants