Skip to content

The Button component has incorrect padding with text and icon position right #60734

@johnhooks

Description

@johnhooks

Description

The Button component of @wordpress/components has incorrect padding with text, icon and iconPosition="right".

It applies the same reduced padding to the left and normal padding on the right, which is intended to improve the look of the button with an icon on the left.

button-padding

This results in a button looking uneven when it has an icon on the right. With the text too close to the left side and the button too far from the right.

button-right-icon-2

Step-by-step reproduction instructions

import { Button } from `@wordpress/components`;
import { wordpress } from `@wordpress/icons`;

function HelloWordPress() {
  return (
    <Button text="Hello" icon={wordpress} iconPosition="right" />
  );
}

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Package] Components/packages/components[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions