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>(), {
33<style scoped> 33<style scoped>
34.VPBadge { 34.VPBadge {
35 display: inline-flex; 35 display: inline-flex;
36 margin-left: 2px; 36 margin-left: 0.125em;
37 border: 1px solid transparent; 37 border: 1px solid transparent;
38 border-radius: 12px; 38 border-radius: 1em;
39 padding: 0 10px; 39 padding: 0 0.75em;
40 line-height: 22px; 40 line-height: 1.5;
41 font-size: 12px; 41 font-size: 0.75em;
42 font-weight: 500; 42 font-weight: 500;
43 transform: translateY(-2px);
44 align-items: center; 43 align-items: center;
45 gap: 0.2rem; 44 gap: 0.25em;
46 padding-right: 10px;
47 vertical-align: middle; 45 vertical-align: middle;
48 /** If the badge is a link, we don't want to apply the link style from global styles. */
49 text-decoration: none !important; 46 text-decoration: none !important;
50} 47}
51 48
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
74.VPBadge.info { 49.VPBadge.info {
75 color: var(--vp-badge-info-text); 50 color: var(--vp-badge-info-text);
76 background-color: var(--vp-badge-info-bg); 51 background-color: var(--vp-badge-info-bg);
@@ -95,4 +70,4 @@ withDefaults(defineProps<Props>(), {
95 color: var(--vp-custom-block-tip-text); 70 color: var(--vp-custom-block-tip-text);
96 background-color: var(--vp-custom-block-tip-bg); 71 background-color: var(--vp-custom-block-tip-bg);
97} 72}
98</style> 73</style>\ No newline at end of file
docs/.vitepress/theme/components/Tooltip.vue +2 −1
@@ -56,6 +56,7 @@ withDefaults(
56 56
57.v-popper { 57.v-popper {
58 display: inline-flex !important; 58 display: inline-flex !important;
59 vertical-align: -0.125em;
59} 60}
60 61
61.v-popper__popper .content ol { 62.v-popper__popper .content ol {
@@ -93,4 +94,4 @@ withDefaults(
93 filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 12px currentColor); 94 filter: drop-shadow(0 0 6px currentColor) drop-shadow(0 0 12px currentColor);
94 transition: filter 0.2s ease; 95 transition: filter 0.2s ease;
95} 96}
96</style> 97</style>\ No newline at end of file