artsy / palette-mobile

Artsy's Design System on Mobile
21 stars 2 forks source link

fix(radio): fix alignment between button and text #206

Closed anandaroop closed 7 months ago

anandaroop commented 7 months ago

This PR resolves ONYX-819

Description

Radio buttons in palette-mobile currently suffer from poor alignment between button and text.

Example from SwA flow in Eigen:

It seems to me that people have worked around this problem in Eigen by building up custom flex layouts that include:

(Examples here and here and here)

I think it would be better to fix this at the root, here in palette-mobile, so that these^ contortions are not necessary and the RadioButton can simply be used as-is, with the text prop.

That's what this PR does:

Before After
before after

There are only a handful of cases in Eigen and Energy where the component is used as-is. Those will just inherit the improved alignment once they upgrade to this version of palette-mobile.

The more custom layouts I cited above should not be affected — though it might be nice to simplify those components and use the improved behavior now.

artsyit commented 7 months ago

:rocket: PR was released in v13.1.22 :rocket: