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

Add basic heading block #4297

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add basic heading block #4297

wants to merge 1 commit into from

Conversation

AshGDS
Copy link
Contributor

@AshGDS AshGDS commented Oct 18, 2024

⚠️ This repo is Continuously Deployed: make sure you follow the guidance ⚠️

What / Why

  • When a govspeak paragraph only contains a YouTube video, it removes the paragraph tag entirely, and therefore the spacing we gain from the <p> styles are lost. Therefore, the heading was right against the video. Both the heading and video were in a govspeak block. Instead, we can create a basic heading block that can be used here, instead of relying on a govspeak paragraph to give us spacing. Our gem heading component has a padding option which will be used to give us the spacing from the video instead.
  • Alternatively, I could make a video block that then renders govspeak and a heading gem component, if that's preferred. However I thought a generic heading block might be useful in other situations.
  • Trello https://trello.com/c/7RFX4SjL/94-video-block-adjustments

Screenshots?

Before

image

After

image

When govspeak only contains a YouTube video, it removes the paragraph tag, and therefore the spacing is lost. Therefore create a basic heading block that can be used instead.
<%= render "govuk_publishing_components/components/heading", {
text: block.data["text"],
heading_level: heading_level,
padding: true
Copy link
Contributor

@leenagupte leenagupte Oct 18, 2024

Choose a reason for hiding this comment

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

I think this should be padding: to pick up the value in block.data["padding"], otherwise it will always be set to true.

Is there a time when the padding shouldn't be set to true? I'm wondering if it should always be true, and therefore not need to be set in the yaml?

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

Successfully merging this pull request may close these issues.

3 participants