Skip to content

Commit

Permalink
fix(theme): default to vertical align top on badges inside headings (#…
Browse files Browse the repository at this point in the history
…1584)

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
  • Loading branch information
shigma and brc-dd committed Nov 30, 2022
1 parent 6ec5489 commit 8a488de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/guide/theme-badge.md
Expand Up @@ -15,10 +15,10 @@ You may use the `Badge` component which is globally available.

Code above renders like:

### Title <Badge type="info" text="default" vertical="middle" />
### Title <Badge type="tip" text="^1.9.0" vertical="middle" />
### Title <Badge type="warning" text="beta" vertical="middle" />
### Title <Badge type="danger" text="caution" vertical="middle" />
### Title <Badge type="info" text="default" />
### Title <Badge type="tip" text="^1.9.0" />
### Title <Badge type="warning" text="beta" />
### Title <Badge type="danger" text="caution" />

## Custom Children

Expand Down
11 changes: 10 additions & 1 deletion src/client/theme-default/components/VPBadge.vue
Expand Up @@ -19,11 +19,20 @@ defineProps<{
border-radius: 10px;
padding: 0 8px;
line-height: 18px;
font-size: 13px;
font-size: 12px;
font-weight: 600;
transform: translateY(-2px);
}
h1 .VPBadge,
h2 .VPBadge,
h3 .VPBadge,
h4 .VPBadge,
h5 .VPBadge,
h6 .VPBadge {
vertical-align: top;
}
h2 .VPBadge {
border-radius: 11px;
line-height: 20px;
Expand Down

0 comments on commit 8a488de

Please sign in to comment.