Skip to content

EuiButtonIcon is missing "secondary" color option #4836

Closed

Description

@masonlr

Looking at the v34.1.0 "Split buttons" example here https://elastic.github.io/eui/#/navigation/button, it's not possible to write something like:

<EuiFlexGroup responsive={false} gutterSize="s" alignItems="center">
  <EuiFlexItem grow={false}>
    <EuiButton size="s" color="secondary">
      Secondary action
    </EuiButton>
  </EuiFlexItem>
  <EuiFlexItem grow={false}>
    <EuiButtonIcon
      display="base"
      size="s"
      color="secondary"
      iconType="boxesVertical"
      aria-label="More"
    />
  </EuiFlexItem>
</EuiFlexGroup>

as the "secondary" option is not available on EuiButtonIcon, even though it's available on EuiButton.

To fix this, the color prop on EuiButtonIcon needs to support the "secondary" option.

Activity

  1. changed the title [-]"secondary" color option missing for EuiButtonEmpty[/-] [+]"secondary" color option missing on EuiButtonIcon[/+] on May 28, 2021
  2. changed the title [-]"secondary" color option missing on EuiButtonIcon[/-] [+]EuiButtonIcon is missing "secondary" color option[/+] on May 28, 2021
  3. masonlr commented on May 28, 2021

    @masonlr
    Author

    Additionally, there seems to be a color mismatch when using for example:

    <EuiFlexGroup responsive={false} gutterSize="s" alignItems="center">
      <EuiFlexItem>
        <EuiButton
          color="warning"
          size="s"
          iconType="unlink"
        >
          Detach Selected Features
        </EuiButton>
      </EuiFlexItem>
      <EuiFlexItem grow={false}>
        <EuiButtonIcon
          display="base"
          color="warning"
          size="s"
          iconType="boxesVertical"
          aria-label="More"
        />
      </EuiFlexItem>
    </EuiFlexGroup>

    image

    The color of the EuiButton element is different to the color of the EuiButtonIcon element, even though both have the "warning" option for the color prop. Maybe this is intended?

  4. elizabetdev commented on May 28, 2021

    @elizabetdev
    Contributor

    Hi @masonlr,

    The "secondary" color option is available on EuiButtonIcon as "success". In our new theme we want to deprecate the idea of secondary color and use instead "success".

    So in your example you need to:

        <EuiFlexGroup responsive={false} gutterSize="s" alignItems="center">
          <EuiFlexItem grow={false}>
            <EuiButton size="s" color="secondary">
              Secondary action
            </EuiButton>
          </EuiFlexItem>
          <EuiFlexItem grow={false}>
            <EuiButtonIcon
              display="base"
              size="s"
              color="success"
              iconType="boxesVertical"
              aria-label="More"
            />
          </EuiFlexItem>
        </EuiFlexGroup>

    I run some tests here and for both examples, the buttons don't quite match the background colors. We should fix this. All colors from the EuiButtonIcon should match the ones from the EuiButton. 😄

  5. masonlr commented on May 28, 2021

    @masonlr
    Author

    Thanks @miukimiu!

    we want to deprecate the idea of secondary color

    Good to know.

    All colors from the EuiButtonIcon should match the ones from the EuiButton.

    Thanks, I kind of moved on when I couldn't get any combination of secondary and success to match! Fixing this so that the EuiButtonIcon and EuiButton styles are consistent would make sense.

  6. self-assigned this
    on Jun 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions