Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(theme): default to vertical align top on badges inside headings #1584

Merged
merged 4 commits into from Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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