Skip to content

fix(button): center SVG icons in flex layout - #135

Merged
fedorovvvv merged 1 commit into
developfrom
fix/button-icon-centering
May 9, 2026
Merged

fix(button): center SVG icons in flex layout#135
fedorovvvv merged 1 commit into
developfrom
fix/button-icon-centering

Conversation

@fedorovvvv

Copy link
Copy Markdown
Collaborator

Summary

Fix vertical centering of SVG icons in buttons by setting display: block on SVG elements within buttons.

Why

SVG elements rendered as inline or inline-flex don't participate correctly in the parent button's flexbox vertical centering (align-items: center). Setting display: block allows SVG elements to respect the parent's centering alignment.

Test plan

  • Visual inspection of buttons with icons on /playground confirms icons are perfectly centered
  • DOM inspection verified centeringDelta: 0 (mathematically perfect centering)
  • All button variants (primary, secondary, ghost, ghost-mono) with icons are centered correctly

SVG icons from @lucide/svelte now display with proper vertical centering
in buttons by applying flex layout to SVG elements. Fixes misaligned
icons in buttons with inline content.
@fedorovvvv
fedorovvvv enabled auto-merge May 9, 2026 15:30
@fedorovvvv
fedorovvvv merged commit e40de52 into develop May 9, 2026
3 checks passed
@fedorovvvv
fedorovvvv deleted the fix/button-icon-centering branch May 9, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant