Gutenberg: Standarize 'close' icon across the UI

Created on 18 Feb 2020  Â·  8Comments  Â·  Source: WordPress/gutenberg

Describe the bug
We are currently using different versions of the 'close' icon in different parts of the UI. It'd be best if we standarize to a single one.

Screenshots
Screen Shot 2020-02-17 at 18 10 39
Screen Shot 2020-02-17 at 18 10 28
Screen Shot 2020-02-17 at 3 58 16 PM

Good First Issue Needs Dev

Most helpful comment

In today's Design triage in slack, we felt the different action of the input field icon was reason enough to keep it different from the other close X icons.

Next steps:

  1. Make the circle icon in the search input field larger so it's clear.
  2. Make the blue icon in the Publish slideout grey so that it matches the other icons.

All 8 comments

In today's Design triage in slack, we felt the different action of the input field icon was reason enough to keep it different from the other close X icons.

Next steps:

  1. Make the circle icon in the search input field larger so it's clear.
  2. Make the blue icon in the Publish slideout grey so that it matches the other icons.

1. The circle icon is a native browser feature for <input type="search">. Every browser renders it a little different. Only Firefox is not showing this icon, but there is an issue in mozillas bugzilla.
There is a way to style this icon in webkit based browsers and IE , see: https://stackoverflow.com/a/20804207/1378097

Chrome
Bildschirmfoto 2020-02-24 um 10 35 36

Safari
Bildschirmfoto 2020-02-24 um 11 08 26

Firefox
Bildschirmfoto 2020-02-24 um 11 08 54

2. I am not able to reproduce the blue icon:
Bildschirmfoto 2020-02-24 um 10 34 43

The circle icon is a native browser feature for . Every browser renders it a little different.

Thanks @Soean, I did not know this!

Given that the clear icon is a native browser element, I don't think we should attempt to style it differently then. What do y'all think? @mapk

I'm still able to reproduce the different colored hover state on the sidebar.

How does this look now in light of G2 being merged? Can you take a look, @enriquesanchez?

@mapk it's a little less noticeable now that we're using those new close icons, but the color difference is still there:

Screen Shot 2020-03-06 at 18 38 55

Screen Shot 2020-03-06 at 18 39 04

I did a little digging and I think I found the source of the problem:

in button/style.scss there's this:

&[aria-expanded="true"],
    &:hover {
        color: $theme-color;
    }

Looks like the close button on the publish panel has the "hover" style because of the aria-expanded attribute. Removing that "fixes" this difference in color, I'm however not sure about why that declaration is there in the first place, and the implications a change like this would have on other buttons.

@joen would you happen to know why we apply the hover style to buttons that have aria-expanded="true"?

@jasmussen I meant to ping you on the above comment and instead pinged someone else.

I'll take a look first thing tomorrow!

Good detective work. The aria-expanded property is at fault, but the rule presence in the button is appropariate — the button SHOULD be blue when toggled/expanded.

The question is: why does the close button have an aria-expanded property set to true in the pre-publish dialog? The close button hasn't opened a menu. So that seems to be the thing to track down and remove.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasmussen picture jasmussen  Â·  3Comments

cr101 picture cr101  Â·  3Comments

davidsword picture davidsword  Â·  3Comments

ellatrix picture ellatrix  Â·  3Comments

franz-josef-kaiser picture franz-josef-kaiser  Â·  3Comments