ic-ui-kit icon indicating copy to clipboard operation
ic-ui-kit copied to clipboard

[ic-button] icon margin causing spacing issue

Open gd2910 opened this issue 1 year ago • 0 comments

Summary of the bug

When IcToggleButton is set to fullWidth with the icon placed on the right, the label and the icon are skewed to the left of the button instead of the centre. This is due to the icon having a margin-right: auto set in the ic-button.css div.right-icon.

🪜 How to reproduce

Go to the IcToggleButton Storybook playground, choose fullWidth: true and iconPlacement: right.

📸 Screenshots or code

The issue stems from margin-right: auto on the .right-icon rule in ic-button.css: image

Using ICDS spacing fixes the issue: image

🧐 Expected behaviour

When in fullWidth and iconPlacement 'right' the label and icon should be centered in the button.

gd2910 avatar May 22 '24 09:05 gd2910