WordPress.org

Make WordPress Core

Opened 4 months ago

Closed 3 months ago

Last modified 5 weeks ago

#50766 closed defect (bug) (fixed)

Not enough padding on "Warning: these page should not be the same!"

Reported by: SergeyBiryukov Owned by: Shital Patel
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: Administration Keywords: good-first-bug has-screenshots has-patch needs-testing
Focuses: ui, css Cc:

Description (last modified by SergeyBiryukov)

  1. Go to Reading Settings.
  2. Assign the same page as Homepage and Posts page.
  3. You'll see the two messages: "Settings saved" and "Warning: these page should not be the same!".
  4. The first message has enough padding, while the second one does not.

This is caused by generic form table styles:

.form-table td p {
    margin-top: 4px;
    margin-bottom: 0;
}

taking precedence over

div.error p {
    margin: 0.5em 0;
    padding: 2px;
}

Adding a notice class to the message fixes the issue.

Note: This also applies to "Warning: these pages should not be the same as your Privacy Policy page!" directly below.

Attachments (3)

50766.png (18.4 KB) - added by SergeyBiryukov 4 months ago.
50766.patch (1.5 KB) - added by Shital Patel 3 months ago.
I added 'notice notice-error' class in div and removed margin-left: 18px; to 0px
Untitled.png (43.1 KB) - added by Shital Patel 3 months ago.
after changes in class and css. please check screenshot of output

Download all attachments as: .zip

Change History (13)

@SergeyBiryukov
4 months ago

#1 @SergeyBiryukov
4 months ago

  • Description modified (diff)

#2 follow-up: @man4toman
4 months ago

In addition, I think inline class name is not required here.
It can be: class="notice error"

#3 in reply to: ↑ 2 @musicaljoeker
4 months ago

Replying to man4toman:

In addition, I think inline class name is not required here.
It can be: class="notice error"

I think if you take away the inline class, it will put the warning at the top of the page. I'm assuming the intended design is to warn at the location where the questionable action was taken.

This ticket was mentioned in PR #438 on WordPress/wordpress-develop by musicaljoeker.


4 months ago

  • Keywords has-patch added; needs-patch removed

…same!" warning

Adding the notice class to the warning fixes this problem.

Props SergeyBiryukov, man4toman.
Fixes #50766

Added the notice class to the Reading Settings front-page-warning.

Trac ticket: https://core.trac.wordpress.org/ticket/50766

#5 follow-up: @garrett-eclipse
4 months ago

@SergeyBiryukov should the error class be replaced by notice notice-info instead of just adding notice?
Just asking to see if it should conform to the commit here.

#6 in reply to: ↑ 5 @SergeyBiryukov
4 months ago

Replying to garrett-eclipse:

should the error class be replaced by notice notice-info instead of just adding notice?
Just asking to see if it should conform to the commit here.

Yeah, it could be replaced with notice notice-error or notice notice-warning, since this message is a warning, rather than just info, unlike the one in [48145].

That said, it looks like there are still a lot of messages with the legacy error class in the admin, so that might be something to handle in another ticket for all of them.

This ticket was mentioned in Slack in #core-css by kirstyburgoine. View the logs.


3 months ago

@Shital Patel
3 months ago

I added 'notice notice-error' class in div and removed margin-left: 18px; to 0px

@Shital Patel
3 months ago

after changes in class and css. please check screenshot of output

#8 @Shital Patel
3 months ago

  • Keywords needs-testing added
  • Owner set to Shital Patel
  • Status changed from new to accepted

#9 @SergeyBiryukov
3 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 48906:

Administration: Correct the padding for "Warning: these pages should not be the same" messages on Reading Settings screen.

Replace the legacy .error class with a more appropriate .notice-warning.

Props musicaljoeker, shital-patel, man4toman, garrett-eclipse, SergeyBiryukov.
Fixes #50766.

Note: See TracTickets for help on using tickets.