Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: checkbox/radio alignment with long text label #1898

Merged
merged 1 commit into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions packages/Field/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ const columnStyles = css`

const checkableFieldStyles = css`
${th('defaultFields.checkablelabel.default')};
margin-bottom: xs;
align-items: flex-start;
overflow-wrap: break-word;

input {
margin-top: xs;
}
`

type StyledFieldProps = {
Expand All @@ -33,11 +38,13 @@ export const Field = styled('div').withConfig({ shouldForwardProp })<StyledField
${StyledLabel} {
${flexDirection === 'row' && rowStyles};
${flexDirection === 'column' && !isCheckable && columnStyles};
${isCheckable && !withHintText && checkableFieldStyles};
${isCheckable && checkableFieldStyles};
${isCheckable && withHintText && th('defaultFields.checkablelabel.default')}
${checked && th('defaultFields.checkablelabel.checked')}
margin-bottom: ${!withHintText && 'xs'}
}
${StyledHint} {
${isCheckable && withHintText && checkableFieldStyles};
margin-bottom: ${isCheckable && 'xxs'};
}
${system};
`
Expand Down
6 changes: 5 additions & 1 deletion packages/Radio/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export const Input = styled.div`

export const Wrapper = styled(Box)`
display: flex;
align-items: center;
align-items: flex-start;
gap: sm;

input {
margin-top: xs;
}
`