Commit 42b708ff2c

42b708ff2ce2b278d22060d324c0838840c9cc7d

parent: bb75f6617a

Unregistered key

M$erable <the_enshittificator@protonmail.com> · 2026-05-05 06:28 UTC
committer: <noreply@github.com>

fix(components): vertically align inline badges and tooltips with text baseline (#160)

Layout: unified · split

docs/.vitepress/theme/components/Badge.vue +7 −32
@@ -33,44 +33,19 @@ withDefaults(defineProps<Props>(), {
3333<style scoped>
3434.VPBadge {
3535 display: inline-flex;
36 margin-left: 2px;
36 margin-left: 0.125em;
3737 border: 1px solid transparent;
38 border-radius: 12px;
39 padding: 0 10px;
40 line-height: 22px;
41 font-size: 12px;
38 border-radius: 1em;
39 padding: 0 0.75em;
40 line-height: 1.5;
41 font-size: 0.75em;
4242 font-weight: 500;
43 transform: translateY(-2px);
4443 align-items: center;
45 gap: 0.2rem;
46 padding-right: 10px;
44 gap: 0.25em;
4745 vertical-align: middle;
48 /** If the badge is a link, we don't want to apply the link style from global styles. */
4946 text-decoration: none !important;
5047}
5148
52.vp-doc h1 > .VPBadge {
53 margin-top: 4px;
54 vertical-align: top;
55}
56
57.vp-doc h2 > .VPBadge {
58 margin-top: 3px;
59 padding: 0 8px;
60 vertical-align: top;
61}
62
63.vp-doc h3 > .VPBadge {
64 vertical-align: middle;
65}
66
67.vp-doc h4 > .VPBadge,
68.vp-doc h5 > .VPBadge,
69.vp-doc h6 > .VPBadge {
70 vertical-align: middle;
71 line-height: 18px;
72}
73
7449.VPBadge.info {
7550 color: var(--vp-badge-info-text);
7651 background-color: var(--vp-badge-info-bg);
@@ -95,4 +70,4 @@ withDefaults(defineProps<Props>(), {
9570 color: var(--vp-custom-block-tip-text);
9671 background-color: var(--vp-custom-block-tip-bg);
9772}
98</style>
73</style>
\ No newline at end of file
docs/.vitepress/theme/components/Tooltip.vue +2 −1
@@ -56,6 +56,7 @@ withDefaults(
5656
5757.v-popper {
5858 display: inline-flex !important;
59 vertical-align: -0.125em;
5960}
6061
6162.v-popper__popper .content ol {
@@ -93,4 +94,4 @@ withDefaults(
9394 filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 12px currentColor);
9495 transition: filter 0.2s ease;
9596}
96</style>
97</style>
\ No newline at end of file