ic-ui-kit
ic-ui-kit copied to clipboard
[ic-button] icon margin causing spacing issue
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:
Using ICDS spacing fixes the issue:
🧐 Expected behaviour
When in fullWidth and iconPlacement 'right' the label and icon should be centered in the button.