Skip to content

Commit 8a488de

Browse files
shigmabrc-dd
andauthored
fix(theme): default to vertical align top on badges inside headings (#1584)
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
1 parent 6ec5489 commit 8a488de

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

docs/guide/theme-badge.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ You may use the `Badge` component which is globally available.
1515

1616
Code above renders like:
1717

18-
### Title <Badge type="info" text="default" vertical="middle" />
19-
### Title <Badge type="tip" text="^1.9.0" vertical="middle" />
20-
### Title <Badge type="warning" text="beta" vertical="middle" />
21-
### Title <Badge type="danger" text="caution" vertical="middle" />
18+
### Title <Badge type="info" text="default" />
19+
### Title <Badge type="tip" text="^1.9.0" />
20+
### Title <Badge type="warning" text="beta" />
21+
### Title <Badge type="danger" text="caution" />
2222

2323
## Custom Children
2424

src/client/theme-default/components/VPBadge.vue

+10-1
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,20 @@ defineProps<{
1919
border-radius: 10px;
2020
padding: 0 8px;
2121
line-height: 18px;
22-
font-size: 13px;
22+
font-size: 12px;
2323
font-weight: 600;
2424
transform: translateY(-2px);
2525
}
2626
27+
h1 .VPBadge,
28+
h2 .VPBadge,
29+
h3 .VPBadge,
30+
h4 .VPBadge,
31+
h5 .VPBadge,
32+
h6 .VPBadge {
33+
vertical-align: top;
34+
}
35+
2736
h2 .VPBadge {
2837
border-radius: 11px;
2938
line-height: 20px;

0 commit comments

Comments
 (0)