Skip to content

Commit

Permalink
refactor($theme-default): badge component (#1439)
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma authored and ulivz committed Mar 13, 2019
1 parent 9c354be commit f516cb4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/@vuepress/theme-default/global-components/Badge.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ export default {
},
render (h, { props, slots }) {
return h('span', {
class: ['badge', props.type, props.vertical]
class: ['badge', props.type],
style: {
verticalAlign: props.vertical
}
}, props.text || slots().default)
}
}
Expand All @@ -29,16 +32,13 @@ export default {
border-radius 3px
padding 0 6px
color white
margin-right 5px
background-color #42b983
&.middle
vertical-align middle
&.top
vertical-align top
&.tip, &.green
background-color #42b983
&.error
background-color #DA5961 //#f66
&.warning, &.warn, &.yellow
background-color darken(#ffe564, 35%)
& + &
margin-left 5px
</style>

0 comments on commit f516cb4

Please sign in to comment.