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

Remove box shadow from FSE block title and description #34256

Merged
merged 1 commit into from
Jun 27, 2019

Conversation

glendaviesnz
Copy link
Contributor

Changes proposed in this Pull Request

I don't feel an actual input field is necessary — it isn't for the Paragraph block.

Testing instructions

  • Load this branch in your FSE testing environment.
  • Add a Site Description and Site Title block to a post.
  • Verify that when each block is selected there is no blue text box border display as below
    no-box

@glendaviesnz glendaviesnz added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 25, 2019
@glendaviesnz glendaviesnz requested a review from a team June 25, 2019 01:54
@glendaviesnz glendaviesnz requested review from a team as code owners June 25, 2019 01:54
@glendaviesnz glendaviesnz self-assigned this Jun 25, 2019
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Seems this is the standard approach that Gutenberg takes on other blocks using PlaintText like core/code or core/html.

@kwight kwight force-pushed the update/fse-block-input-style branch from 5527d61 to f0643dc Compare June 25, 2019 18:10
@kwight
Copy link
Contributor

kwight commented Jun 25, 2019

Seems this is the standard approach that Gutenberg takes on other blocks using PlaintText like core/code or core/html.

I'm seeing the border around the html block when active, which we don't have in this PR:

Screen Shot 2019-06-25 at 11 14 20 AM

I actually assumed that having it when focused was an a11y thing, and that removing it would defeat that; are we understanding your comments correctly @jasmussen ?..

Copy link
Contributor

@kwight kwight left a comment

Choose a reason for hiding this comment

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

Just left some comments for further clarification first.

@kwight
Copy link
Contributor

kwight commented Jun 25, 2019

@glendaviesnz Oh, I also rebased to pull in #34237 , so that your PHPCS results here were more understandable (there's only unrelated issues 👍).

@glendaviesnz
Copy link
Contributor Author

glendaviesnz commented Jun 25, 2019

I actually assumed that having it when focused was an a11y thing, and that removing it would defeat that;

It looks like the HTML block is the only one that keeps the blue border on focus. A quick glance at A11y guidelines seems to indicate that the key thing is to show that the field has focus somehow - so maybe with the the likes of paragraph and heading blocks the full block wrapper is seen as indication enough - but will wait to see what @jasmussen has to say.

@mmtr
Copy link
Member

mmtr commented Jun 26, 2019

Seems this is the standard approach that Gutenberg takes on other blocks using PlaintText like core/code or core/html.

I'm seeing the border around the html block when active, which we don't have in this PR:

Screen Shot 2019-06-25 at 11 14 20 AM

I actually assumed that having it when focused was an a11y thing, and that removing it would defeat that; are we understanding your comments correctly @jasmussen ?..

I should have manually verified how the blocks look like rather than getting wrong assumptions from the code 😅.

But yeah, the box shadow is not displayed on those blocks but we still have a border around them coming from a border style.

Even though, I think it's ok to don't have any border around the input in order to match the same style we will get in the published view (which is the goal of the block editor). I think that's the reasoning behind the lack of any border on the paragraph inputs and probably showing the block box and toolbar is enough as @glendaviesnz pointed out.

That also explains why we show a border on the code block since that border will also appear in the published view and probably it is not related to an a11y enhancement. The HTML block is a different scenario, because the entered content will produce a different output on the published, so maybe the border is displayed just to differentiate these blocks from the other WYSIWYG blocks like paragraphs or headings.

@jasmussen
Copy link
Member

Here's the core block:

html block

In general the principles for block design is that the unselected state of the block should match what you see on the frontend, while the selected state both shows the selected block borders, and if necessary, any additional UI (such as the caption field popping out on an image). So normally we would not want those borders, because they are not reflected on the frontend.

However the custom HTML block is a bit of a special case, since it literally is custom HTML — you could write any code in there. For this block, the important bit is that the preview tab shows something that is front-end accurate, which is the case:

Screenshot 2019-06-26 at 08 57 31

In other words, the gray border around the custom HTML block exists to indicate the boundaries of this contiguous chunk of custom HTML, even when you're typing and the block borders fade out. Think of it as a textarea, which therefore should have similar styles to a textarea.

The additional focus style wasn't there last I worked on the block, which means it has intentionally been added, and it makes sense — I only wish it used the same focus style as the actual textarea does, i.e. ligher blue and 2px solid. But that's something to fix in the upstream project.

I would recommend keeping it. CC: @enriquesanchez in case he has input.

@glendaviesnz
Copy link
Contributor Author

@kwight are you happy with this now with the additional discussion?

@kwight
Copy link
Contributor

kwight commented Jun 26, 2019

Whatever works for the designers, absolutely 👍

@glendaviesnz glendaviesnz merged commit 9eaea9a into master Jun 27, 2019
@matticbot matticbot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 27, 2019
@glendaviesnz glendaviesnz deleted the update/fse-block-input-style branch June 28, 2019 00:07
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.

5 participants