Skip to content

Commit

Permalink
rearrange borderWidth and borderStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
kkir committed Mar 21, 2019
1 parent d43d3ac commit c52e292
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -469,12 +469,12 @@ export const borderRadius = style({

export const borders = compose(
border,
borderStyle,
borderWidth,
borderTop,
borderRight,
borderBottom,
borderLeft,
borderWidth,
borderStyle,
borderColor,
borderRadius
)
Expand Down
14 changes: 12 additions & 2 deletions test/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,16 @@ test('colors prop returns theme.colorStyles object', t => {
})

test('borders prop returns correct sequence', t => {
const a = borders({ borderBottom: '1px solid', borderColor: 'red' })
t.deepEqual(a, [{ borderBottom: '1px solid' }, { borderColor: 'red' }])
const a = borders({
borderBottom: '1px solid',
borderWidth: '2px',
borderStyle: 'dashed',
borderColor: 'red',
})
t.deepEqual(a, [
{ borderBottom: '1px solid' },
{ borderWidth: '2px' },
{ borderStyle: 'dashed' },
{ borderColor: 'red' },
])
})

0 comments on commit c52e292

Please sign in to comment.