Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 15 additions & 20 deletions docs/.vitepress/theme/components/HomeHeroInfo.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useData } from 'vitepress'
import { VPBadge } from 'vitepress/theme'
import { xmakeRelease } from '../../data/xmake-release.js'

type HeroConfig = {
Expand Down Expand Up @@ -46,7 +47,7 @@ const badgeTitle = computed(() => {
:title="badgeTitle"
:aria-label="badgeTitle"
>
{{ releaseTag }}
<VPBadge class="small xmake-release-badge-chip" type="tip" :text="releaseTag" />
</a>
</span>
<span v-if="hero.text" v-html="hero.text" class="text"></span>
Expand Down Expand Up @@ -109,29 +110,23 @@ const badgeTitle = computed(() => {
}

.xmake-release-badge {
display: inline-flex;
align-items: flex-start;
position: relative;
top: -1.9em;
margin-left: 0.04em;
padding: 0.05em 0.16em;
border-radius: 0.45em;
background: transparent;
color: var(--vp-c-brand-1);
text-decoration: underline;
text-decoration-color: transparent;
text-underline-offset: 0.16em;
top: -0.6em;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The top offset is defined in em units relative to the inherited font size (which scales from 32px to 56px across breakpoints), but the VPBadge now has a fixed size (via the small class). This causes the badge's vertical position to shift inconsistently relative to its own height as the screen size changes. Consider using a fixed offset (e.g., in px) or setting a fixed font-size on this wrapper so the em offset remains proportional to the badge itself.

margin-left: 0.08em;
text-decoration: none;
white-space: nowrap;
font-size: 0.26em;
line-height: 1;
font-weight: 700;
letter-spacing: 0.01em;
font-variant-numeric: tabular-nums;
transition: background-color 0.2s ease, color 0.2s ease, text-decoration-color 0.2s ease;
}

.xmake-release-badge:hover {
background: rgba(66, 211, 146, 0.12);
color: var(--vp-c-brand-2);
text-decoration-color: currentColor;
.xmake-release-badge-chip {
margin-left: 0;
transform: none;
transition: filter 0.2s ease, box-shadow 0.2s ease;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The transition property includes box-shadow, but no box-shadow is defined or modified on hover for the .xmake-release-badge-chip. This is unnecessary code and should be cleaned up.

  transition: filter 0.2s ease;

}

.xmake-release-badge:hover .xmake-release-badge-chip {
filter: brightness(1.08);
}

@media (min-width: 640px) {
Expand Down
Loading