Skip to content

Commit

Permalink
πŸ’„ Fix radio and checkbox label padding (#1643)
Browse files Browse the repository at this point in the history
* πŸ’„ Removed extra padding between input and label

* πŸ“Έ Update snapshots
  • Loading branch information
oddvernes authored Oct 21, 2021
1 parent 01e7c82 commit e145250
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ export const checkbox: CheckboxToken = {
},
},
},
entities: {
label: {
spacings: {
left: medium_small,
},
},
},
modes: {
compact: {
spacings: {
Expand Down
3 changes: 1 addition & 2 deletions libraries/core-react/src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { forwardRef, Ref, InputHTMLAttributes } from 'react'
import styled from 'styled-components'
import { checkbox as tokens } from './Checkbox.tokens'
import { typographyTemplate, spacingsTemplate } from '../../utils'
import { typographyTemplate } from '../../utils'
import { CheckboxInput } from './Input'

type StyledLabelProps = {
Expand All @@ -17,7 +17,6 @@ const StyledLabel = styled.label<StyledLabelProps>`

const LabelText = styled.span`
${typographyTemplate(tokens.typography)};
${spacingsTemplate(tokens.entities.label.spacings)}
`

export type CheckboxProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ exports[`Checkbox Matches snapshot 1`] = `
-ms-letter-spacing: 0.013em;
letter-spacing: 0.013em;
text-align: left;
padding-left: 12px;
}
@media (hover:hover) and (pointer:fine) {
Expand Down
7 changes: 0 additions & 7 deletions libraries/core-react/src/components/Radio/Radio.tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ export const comfortable: RadioToken = {
},
},
},
entities: {
label: {
spacings: {
left: medium_small,
},
},
},
modes: {
compact: {
spacings: {
Expand Down
1 change: 0 additions & 1 deletion libraries/core-react/src/components/Radio/Radio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ const Svg = styled.svg.attrs(({ height, width, fill }) => ({

const LabelText = styled.span`
${typographyTemplate(tokens.typography)}
${spacingsTemplate(tokens.entities.label.spacings)}
`

type StyledInputWrapperProps = { disabled: boolean }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ exports[`Radio Matches snapshot 1`] = `
-ms-letter-spacing: 0.013em;
letter-spacing: 0.013em;
text-align: left;
padding-left: 12px;
}
.c1 {
Expand Down

0 comments on commit e145250

Please sign in to comment.