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

Add Block "+" icon has different hover effects #14853

Closed
mapk opened this issue Apr 5, 2019 · 5 comments · Fixed by #14936
Closed

Add Block "+" icon has different hover effects #14853

mapk opened this issue Apr 5, 2019 · 5 comments · Fixed by #14936
Labels
Needs Design Feedback Needs general design feedback.

Comments

@mapk
Copy link
Contributor

mapk commented Apr 5, 2019

Describe the bug
The Add Block "+" icon shows different hover effects within the editor.

To reproduce
Steps to reproduce the behavior:

  1. Create a new post.
  2. Without anything selected hover over an existing block's sibling inserter and observe there is no outline.
  3. Without anything selected hover over the bottom new block inserter and observe an outline around it that appears off-center.

Expected behavior
There is a color change in the sibling inserter which indicates (subtly) the hover effect. In the new block inserter, there is no color change, so maybe that's why there is an outline? If we want to keep the outline to indicate the hover effect, then we should at least center it around the "+".

Screenshots

plus-icon

Desktop (please complete the following information):

  • OS: OSX
  • Browser FIrefox
  • Gutenberg 5.4
@mapk mapk added the Needs Design Feedback Needs general design feedback. label Apr 5, 2019
@mapk
Copy link
Contributor Author

mapk commented Apr 5, 2019

Somewhat related to #10519

@m-e-h
Copy link
Member

m-e-h commented Apr 8, 2019

This would be because this:

.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle:not(:disabled):not([aria-disabled="true"]):hover {
    
    box-shadow: none;

is more specific than this:

.components-icon-button:not(:disabled):not([aria-disabled="true"]):not(.is-default):hover {

    box-shadow: inset 0 0 0 1px #e2e4e7,inset 0 0 0 2px #fff,0 1px 1px rgba(25,30,35,.2);

The :not() is equal specificity on both, since it only counts the most specific value in the list.

So essentially it's

.block-editor-block-list__insertion-point-inserter .block-editor-inserter__toggle

vs

.components-icon-button

Is there ever a case where a block-editor-inserter__toggle would exist without a block-editor-block-list__insertion-point-inserter? If not then that qualifier class isn't necessary .

Of course it may be intentional. Hard to tell.

@mapk
Copy link
Contributor Author

mapk commented Apr 10, 2019

Thanks for that investigation work @m-e-h!
@karmatosed or @jasmussen any word on why these + icons have different hover effects? Should they be the same?

@jasmussen
Copy link
Contributor

On a meta-level, all icon buttons should have the same treatment. Which means the sibling inserter should have the same style as the buttons in the toolbar.

The reason it's the way it is now, is that the circular inserter button would look weird with that square hover style. Which is why it's the way it is now, with no hover background on the sibling, and a circular one on the left inserter.

A stopgap solution is to remove the box shadow hover style on the left inserter, then it's at least 50% more consistent. But perhaps a better solution is to re-do the hover style for icon buttons in general? Referring also to the icon buttons in the editor bar up top.

I'll think about how those can be tightened up, but that should probably be done as a subsequent PR.

kjellr added a commit that referenced this issue Apr 11, 2019
Fixes #14853.

This removes the box shadow on the inserter button that appears to the left of the default block appender (or to the right on mobile).

This brings the hover state in line with the hover state for the sibling inserter.
@kjellr
Copy link
Contributor

kjellr commented Apr 11, 2019

A stopgap solution is to remove the box shadow hover style on the left inserter, then it's at least 50% more consistent. But perhaps a better solution is to re-do the hover style for icon buttons in general? Referring also to the icon buttons in the editor bar up top.

I'll think about how those can be tightened up, but that should probably be done as a subsequent PR.

Fully agree- it might be nice to re-evaluate those hover states in general. (I'd also love to kill off that pile of :not() selectors if at all possible).

In the meantime, I opened #14936 to remove the box shadow for this icon.

kjellr added a commit that referenced this issue Apr 12, 2019
Fixes #14853.

This removes the box shadow on the inserter button that appears to the left of the default block appender (or to the right on mobile).

This brings the hover state in line with the hover state for the sibling inserter.
mchowning pushed a commit to mchowning/gutenberg that referenced this issue Apr 15, 2019
Fixes WordPress#14853.

This removes the box shadow on the inserter button that appears to the left of the default block appender (or to the right on mobile).

This brings the hover state in line with the hover state for the sibling inserter.
aduth pushed a commit that referenced this issue Apr 16, 2019
Fixes #14853.

This removes the box shadow on the inserter button that appears to the left of the default block appender (or to the right on mobile).

This brings the hover state in line with the hover state for the sibling inserter.
aduth pushed a commit that referenced this issue Apr 16, 2019
Fixes #14853.

This removes the box shadow on the inserter button that appears to the left of the default block appender (or to the right on mobile).

This brings the hover state in line with the hover state for the sibling inserter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants