Skip to content

Commit

Permalink
fix(badge): add flex styles to badge
Browse files Browse the repository at this point in the history
adding flex styles so it has better bahavior when used alongside other elements. the remove of py is
accounted by increasing line-height

BREAKING CHANGE: it now behaves as inline-flex instead of default inline span. py-1 was also removed
in favor of leading increase, so it better aligns in the center of the pill.
  • Loading branch information
estevanmaito committed Jul 7, 2020
1 parent 26472c6 commit bf7c412
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/Badge.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ describe('Badge', () => {
})

it('should render with base styles', () => {
const expected = 'px-2 py-1 text-xs font-medium leading-none rounded-full'
const expected = 'inline-flex px-2 text-xs font-medium leading-5 rounded-full'
const wrapper = mount(<Badge />)

expect(wrapper.find('span').getDOMNode().getAttribute('class')).toContain(expected)
Expand Down
2 changes: 1 addition & 1 deletion src/themes/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default {
},
// Badge
badge: {
base: 'px-2 py-1 text-xs font-medium leading-none rounded-full',
base: 'inline-flex px-2 text-xs font-medium leading-5 rounded-full',
success: 'text-green-700 bg-green-100 dark:bg-green-700 dark:text-green-100',
danger: 'text-red-700 bg-red-100 dark:text-red-100 dark:bg-red-700',
warning: 'text-orange-700 bg-orange-100 dark:text-white dark:bg-orange-600',
Expand Down

0 comments on commit bf7c412

Please sign in to comment.