Skip to content

Commit

Permalink
fix: checkbox/radio alignment with long text label (#1898)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vico4 committed Feb 2, 2023
1 parent bb7b56c commit 38f1aed
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
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;
}
`

0 comments on commit 38f1aed

Please sign in to comment.