Skip to content

Commit

Permalink
fix: properly handle multiple values in "border-radius"
Browse files Browse the repository at this point in the history
Fixes #28
  • Loading branch information
gregberge committed Jun 22, 2019
1 parent 0a55e20 commit 23a3aa0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/propGetters.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const propGetters = {
'border-left-color': getColor,

// getRadius
'border-radius': getNumber(getRadius),
'border-radius': getMultiValues(getNumber(getRadius)),

// getBorder
border: getNumberBorder,
Expand Down
16 changes: 16 additions & 0 deletions packages/core/src/propGetters.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { propGetters } from './propGetters'

describe('#propGetters', () => {
describe('border-radius', () => {
it('handles several values', () => {
expect(propGetters['border-radius']('10')({})).toBe('10px')
expect(propGetters['border-radius']('1 2')({})).toBe('1px 2px')
expect(
propGetters['border-radius']('md')({ theme: { radii: { md: 10 } } }),
).toBe('10px')
expect(
propGetters['border-radius']('md md')({ theme: { radii: { md: 10 } } }),
).toBe('10px 10px')
})
})
})

0 comments on commit 23a3aa0

Please sign in to comment.