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

Twenty Twenty-one - Heading block takes extra padding while adding a background #40144

Closed
kmadhak opened this issue Apr 7, 2022 · 5 comments · Fixed by #43454 · May be fixed by #40180
Closed

Twenty Twenty-one - Heading block takes extra padding while adding a background #40144

kmadhak opened this issue Apr 7, 2022 · 5 comments · Fixed by #43454 · May be fixed by #40180
Assignees
Labels
[Block] Heading Affects the Headings Block CSS Styling Related to editor and front end styles, CSS-specific issues.

Comments

@kmadhak
Copy link

kmadhak commented Apr 7, 2022

Description

When I try to add a background colour in h1 tag of heading block then the extra padding got added, so the text is visible in multiline, for more detail please find the attachment of the video and let me know if there is anything.

Step-by-step reproduction instructions

  1. Go to editor.
  2. Add a heading block.
  3. Select H1 tag for heading.
  4. Click on accordion color from setting side bar.
  5. Choose any background color.

Screenshots, screen recording, code snippet

Recording.30.mp4

Environment info

WordPress Version:- 5.9.3
Browser: Google Chrome 100.0.4896.75 (Official Build) (arm64)
OS Version: Mac 12.3.1

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@sabernhardt
Copy link
Contributor

In #24523, em was preferred over rem, but at least heading blocks would be more consistent using rem values.

// Padding for blocks with a background color (e.g. paragraph or group).
$block-bg-padding--v: 1.25em;
$block-bg-padding--h: 2.375em;

h1,
h2,
h3,
h4,
h5,
h6 {
&.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
}
}

@aezazs-multidots
Copy link

aezazs-multidots commented Apr 8, 2022

Hello @kmadhak

The same issue coming in the Twenty Twenty-Two theme too.

I have started working on this issue. I will update here when it is complete.

Thanks

@aezazs-multidots
Copy link

Hi @sabernhardt @kmadhak

I have fixed this issue and have also created PR for it.

Please review this PR link: #40180

Than you !

@ndiego ndiego added CSS Styling Related to editor and front end styles, CSS-specific issues. [Block] Heading Affects the Headings Block labels Apr 8, 2022
@ndiego
Copy link
Member

ndiego commented Apr 8, 2022

WordPress core provides default padding to Heading blocks with a background color, but most themes override this with their own custom styles. That said, as you indicated the defaults add way too much padding in nearly all cases. Thanks for the PR @aezazs-multidots.

@ndiego ndiego linked a pull request Apr 8, 2022 that will close this issue
@kmadhak
Copy link
Author

kmadhak commented May 9, 2022

Hello @ndiego,

Greetings of the day!!!

I would like to know the progress of this issue, please let me know if you need more detail on it.

Thank you.

@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Aug 21, 2022
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Heading Affects the Headings Block CSS Styling Related to editor and front end styles, CSS-specific issues.
Projects
None yet
5 participants