Make WordPress Core

Opened 2 years ago

Closed 3 weeks ago

Last modified 3 weeks ago

#62356 closed defect (bug) (wontfix)

Twenty Fifteen : On Adding background color to Navigation Block padding added in editor but not in frontend

Reported by: pitamdey Owned by:
Priority: normal Milestone:
Component: Bundled Theme Version: 6.1
Severity: normal Keywords: has-screenshots has-test-info close
Cc: Focuses:

Description

In Twenty Fifteen Theme,
When we add background color to navigation block we can see a padding added in the editor side but not in the frontend side

Can we just make the two side similar

I have added a screenshot for better understanding

Attachments (3)

Screenshot 2024-11-07 at 5.51.04 PM.png​ (319.0 KB ) - added by pitamdey 2 years ago.
Editor View
Screenshot 2024-11-07 at 5.51.22 PM.png​ (418.9 KB ) - added by pitamdey 2 years ago.
Frontend View
62356.patch​ (876 bytes ) - added by pitamdey 2 years ago.
After applying this solution the issue is resolved

Download all attachments as: .zip

Change History (15)

#1 @tusharaddweb
2 years ago

@pitamdey You have to add navigation to the group block and give it padding so that the padding in the editor and front view are the same.

#2 @pitamdey
2 years ago

Hi @tusharaddweb ...In other themes, it works well without adding the group block and custom padding. So I think it should work here also.

Let me know what your view on this

Thank you

@pitamdey
2 years ago

After applying this solution the issue is resolved

This ticket was mentioned in ​Slack in #core-test by oglekler. ​View the logs.


2 years ago

#4 @sukhendu2002
2 years ago

Reproduction Report

Description

In the Twenty Fifteen theme, when a background color is added to the navigation block, padding appears in the editor view but is not visible on the frontend, causing the editor and frontend to display inconsistently.

Environment

  • WordPress: 6.7
  • PHP: 8.1.29
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.29)
  • Browser: Chrome 130.0.6723.58
  • OS: macOS
  • Theme: Twenty Fifteen 3.9
  • MU Plugins: None activated
  • Plugins: Test Reports 1.2.0

Actual Results

  1. Padding appears in the editor but is missing on the frontend.

#5 @sukhendu2002
2 years ago

Test Report

Description

This report verifies that the indicated patch resolves the issue by correcting the inconsistency in padding between the editor and frontend views for the navigation block in the Twenty Fifteen theme.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/62356/62356.patch

Environment

  • WordPress: 6.7
  • PHP: 8.1.29
  • Server: nginx/1.16.0
  • Database: mysqli (Server: 8.0.16 / Client: mysqlnd 8.1.29)
  • Browser: Chrome 130.0.6723.58
  • OS: macOS
  • Theme: Twenty Fifteen 3.9
  • MU Plugins: None activated
  • Plugins: Test Reports 1.2.0

Actual Results

  1. ✅ After applying the patch, the padding for the navigation block appears consistently on both the editor and frontend, confirming that the issue is resolved.

#6 @im3dabasia1
2 years ago

  • Keywords has-testing-info added

Reproduction Report

Description

This report validates whether the issue can be reproduced.

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.25
  • Server: nginx/1.27.2
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
  • Browser: Chrome 129.0.0.0
  • OS: macOS
  • Theme: Twenty Fifteen 3.9
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Error condition occurs (reproduced).

Supplemental Artifacts

Editor: https://i.postimg.cc/kg4QqqTH/Screenshot-2024-12-04-at-10-51-22-PM.png
Frontend: https://i.postimg.cc/0j0Y2QgT/Screenshot-2024-12-04-at-10-48-20-PM.png

Last edited 2 years ago by im3dabasia1 (previous) (diff)

#7 @im3dabasia1
2 years ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://core.trac.wordpress.org/attachment/ticket/62356/62356.patch

Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.25
  • Server: nginx/1.27.2
  • Database: mysqli (Server: 8.0.40 / Client: mysqlnd 8.2.25)
  • Browser: Chrome 129.0.0.0
  • OS: macOS
  • Theme: Twenty Fifteen 3.9
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.0

Actual Results

  1. ✅ Issue resolved with patch.

Supplemental Artifacts

Frontend: https://i.postimg.cc/63dRY3Q8/Screenshot-2024-12-04-at-10-48-57-PM.png

#8 @wordpressdotorg
18 months ago

  • Keywords has-test-info added; has-testing-info removed

#9 @darshitrajyaguru97
3 months ago

Test Report

Summary

Test Environment

  • WordPress: 6.8-alpha-59274-src
  • PHP: 8.2.25
  • Server: nginx/1.27.2
  • Database: MySQL 8.0.40
  • Browser: Chrome 129.0.0.0
  • Operating System: Windows 11
  • Theme: Twenty Fifteen
  • MU Plugins: None
  • Active Plugins:
    • Test Reports 1.2.0

Testing Results

  • Applied the patch.
  • Verified the affected functionality.
  • Confirmed that the reported issue is no longer reproducible after applying the patch.
  • No unexpected behavior or regressions were observed during testing.

Outcome

✅ Tested successfully. The patch fixes the reported issue and performs as expected.

#10 @karmatosed
3 weeks ago

  • Keywords close added

I understand what this is doing but to me, I am reluctant to change padding on a theme that has been out a while and has had child themes potentially doing similar things. We have to think of the implications of fixing downstream. I do appreciate the work people have done, this isn't a judgement against that.

I would therefore, propose this doesn't get resolved in the theme and for now as there is a workaround, which people are most likely using, that is the path forward.

#11 @karmatosed
3 weeks ago

  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → closed

As per my suggestion above I am now going to go through and close this. I do appreciate everyone's contribution so far. It's worth noting that closing is a state, not a dead-end. We can always reconsider based on feedback and input. Thank you again.

#12 @sabernhardt
3 weeks ago

  • Version → 6.1

I agree about closing the ticket.

  • The block's default padding, shown in the editor, seems too thick to me with the bottom border and with the dropdown chevron icons.
  • I prefer the workaround of adding custom padding on a Group block so it is around all items but not each individual link.

The Navigation block was not available until WordPress 5.9, and Twenty Fifteen only allows it within a post. WordPress 6.1 reduced the specificity of the block selector to zero (GB42967), less than Twenty Fifteen has for a elements in its ​CSS reset on the front end.

I considered adding a smaller amount of padding in both stylesheets, but leaving the ticket closed is probably better than trying that approach.

using rem in blocks.css

:where(.wp-block-navigation.has-background .wp-block-navigation-item) a:not(.wp-element-button) {
	padding: 0.5rem;
}

using px in editor-blocks.css

:where(.wp-block-navigation.has-background .wp-block-navigation-item) a:not(.wp-element-button) {
	padding: 5px;
}
Note: See TracTickets for help on using tickets.