Make WordPress Core

Opened 8 weeks ago

Closed 6 weeks ago

#61888 closed defect (bug) (fixed)

Twenty Seventeen: Search block button's styles are not set in the editor

Reported by: viralsampat's profile viralsampat Owned by: karmatosed's profile karmatosed
Milestone: 6.7 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch needs-testing commit
Focuses: css Cc:

Description

Hello Team,

I have checked "Search Block" and found that it's button background color, text color, and font-weight is not same on back-end & front-end.

I think that it should be same on the both sides(Back-end & Front-end).

Here, I have provided its screenshots for reference.

Thanks,

Attachments (8)

twenty-seventeen-search-block-editor.png (172.1 KB) - added by viralsampat 8 weeks ago.
Back-end:
twenty-seventeen-search-block-front-end.png (278.9 KB) - added by viralsampat 8 weeks ago.
Front-end:
61888.patch (673 bytes) - added by shailu25 7 weeks ago.
Patch Added.
61888.button-styles.patch (810 bytes) - added by sabernhardt 7 weeks ago.
option 1: removes the font size and moves the new rules to the Widgets section
61888.label-input-button.patch (1.1 KB) - added by sabernhardt 7 weeks ago.
option 2: removes font size, moves new rules, and adds some styles for the Search block label and input
Search-blocks-front.png (31.8 KB) - added by sabernhardt 7 weeks ago.
Search blocks with default styling and large font size preset in both post content and a widget, on the front end
Search-blocks-editor-1.png (33.0 KB) - added by sabernhardt 7 weeks ago.
editor styles with patch option 1 (button only)
Search-blocks-editor-2.png (31.9 KB) - added by sabernhardt 7 weeks ago.
editor styles with patch option 2 (button, label and input styles)

Download all attachments as: .zip

Change History (18)

#1 @pamprn
7 weeks ago

Should frontend or backend be the determinant?

#2 @sabernhardt
7 weeks ago

  • Keywords dev-feedback needs-testing removed
  • Milestone changed from Awaiting Review to Future Release
  • Summary changed from Twenty seventeen theme: Search block button's behaviour not same on editor and front-end. to Twenty Seventeen: Search block button's styles are not set in the editor

The editor-blocks stylesheet needs styles to match button styles on the front end.

/* Search */

.wp-block-search__button {
	background-color: #222;
	color: #fff;
	font-size: 16px;
	font-weight: 800;
	line-height: 1.5;
}

@shailu25
7 weeks ago

Patch Added.

#3 @shailu25
7 weeks ago

  • Keywords has-patch added; needs-patch removed

#4 @karmatosed
7 weeks ago

  • Keywords needs-testing added
  • Milestone changed from Future Release to 6.7

I am going to test this now thanks.

#5 @karmatosed
7 weeks ago

I can confirm this patch now resolves it being the same in both experiences. Thank you everyone.

#6 @karmatosed
7 weeks ago

  • Keywords commit added

#7 @karmatosed
7 weeks ago

  • Owner set to karmatosed
  • Resolution set to fixed
  • Status changed from new to closed

In 58911:

Twenty Seventeen Fixes search block button styles not being the same.

The search block button was not the same back and front for background, text and font weight. This also reflects in editor-blocks stylesheet.

Props viralsampat, pamprn, sabernhardt, shailu25.
Fixes #61888.

@sabernhardt
7 weeks ago

option 1: removes the font size and moves the new rules to the Widgets section

@sabernhardt
7 weeks ago

option 2: removes font size, moves new rules, and adds some styles for the Search block label and input

@sabernhardt
7 weeks ago

Search blocks with default styling and large font size preset in both post content and a widget, on the front end

@sabernhardt
7 weeks ago

editor styles with patch option 1 (button only)

@sabernhardt
7 weeks ago

editor styles with patch option 2 (button, label and input styles)

#8 @sabernhardt
7 weeks ago

  • Keywords commit removed
  • Resolution fixed deleted
  • Status changed from closed to reopened

This should have an iteration, and I uploaded two options.

  1. I was wrong about adding a font-size in the button styles. The theme uses the same size for body and button, and my suggestion would override theme preset classes for font size.
  2. The new styles are located in the middle of the Quote block's styles. They would fit better in the Widgets section, at the end of the file.
  3. The label and input are slightly different in the editor, though I am not sure whether trying to match those to the front is worth an extra 15 lines. I chose not to copy the theme's form element styles into editor-style.css (form elements can be used in other situations, but that is about 100 lines and the Search label still would need its own rules).

Extra styles to consider in 61888.label-input-button.patch:

  • The label sets a font-weight of 700 in the editor and 800 on the front (which does not look any different for me because the theme does not have font files for the 700 weight).
  • The label's 0.5em margin on the front is missing in the editor, and that is more noticeable with larger fonts.
  • Adding the input's #333 text color would override the admin styles (forms.css, which give the search input a very similar #2c3338. I also included the background color and gradient to make sure it has contrast.
  • The input border radius is also very similar to the admin styles (3 pixels instead of 4).
  • Inputs have a lighter border in Twenty Seventeen than what admin styles or the block-library styles define.
  • The input padding and line-height could also match the front end.

#9 @karmatosed
6 weeks ago

  • Keywords commit added
  • Status changed from reopened to assigned

My instinct is that the first patch is a good one to get in @sabernhardt and we can always consider having the extra styles even in another issue. As a result I am going to push that one through for now.

#10 @karmatosed
6 weeks ago

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

In 58930:

Twenty Seventeen: Fixes search block button styling variations.

The search block button was not the same back and front for background, text and font weight. This is an additional patch solving the previous issue of styles being in wrong section and also differences..

Props sabernhardt.
Fixes #61888.

Note: See TracTickets for help on using tickets.