Skip to content

Commit

Permalink
refactor: use px for number
Browse files Browse the repository at this point in the history
  • Loading branch information
toshusai committed Mar 5, 2024
1 parent 6ab49f7 commit 3ef2c15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions packages/styled/src/utils/gap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ export function gap(

export function gap(v1: keyof Spacing, v2?: keyof Spacing) {
return css`
gap: ${pxIfNum(v1)} ${pxIfNum(v2)};
gap: ${v1}px ${pxIfNum(v2)};
`
}

export function rowGap(v: keyof Spacing) {
return css`
row-gap: ${pxIfNum(v)};
row-gap: ${v}px;
`
}

export function columnGap(v: keyof Spacing) {
return css`
column-gap: ${pxIfNum(v)};
column-gap: ${v}px;
`
}
10 changes: 5 additions & 5 deletions packages/styled/src/utils/padding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ export function padding(
arg4?: keyof Spacing
) {
return css`
padding: ${pxIfNum(arg1)} ${pxIfNum(arg2)} ${pxIfNum(arg3)} ${pxIfNum(arg4)};
padding: ${arg1}px ${pxIfNum(arg2)} ${pxIfNum(arg3)} ${pxIfNum(arg4)};
`
}

export function paddingTop(v: keyof Spacing) {
return css`
padding-top: ${pxIfNum(v)};
padding-top: ${v}px;
`
}

export function paddingBottom(v: keyof Spacing) {
return css`
padding-bottom: ${pxIfNum(v)};
padding-bottom: ${v}px;
`
}

export function paddingLeft(v: keyof Spacing) {
return css`
padding-left: ${pxIfNum(v)};
padding-left: ${v}px;
`
}

export function paddingRight(v: keyof Spacing) {
return css`
padding-right: ${pxIfNum(v)};
padding-right: ${v}px;
`
}

0 comments on commit 3ef2c15

Please sign in to comment.