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
29 changes: 28 additions & 1 deletion app/pages/package/[...package].vue
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ defineOgImageComponent('Package', {
<button
type="button"
@click="copyPkgName()"
class="copy-button absolute z-20 left-0 top-full inline-flex items-center gap-1 px-2 py-1 rounded border text-xs font-mono whitespace-nowrap text-fg-muted bg-bg border-border opacity-0 -translate-y-1 pointer-events-none transition-all duration-150 group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto focus-visible:opacity-100 focus-visible:translate-y-0 focus-visible:pointer-events-auto hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/40"
class="copy-button absolute z-20 left-0 top-full inline-flex items-center gap-1 px-2 py-1 rounded border text-xs font-mono whitespace-nowrap text-fg-muted bg-bg border-border opacity-0 -translate-y-1 pointer-events-none group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto focus-visible:opacity-100 focus-visible:translate-y-0 focus-visible:pointer-events-auto hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/40"
:aria-label="$t('package.copy_name')"
>
<span class="i-carbon:copy w-3.5 h-3.5" aria-hidden="true" />
Expand Down Expand Up @@ -1191,6 +1191,33 @@ defineOgImageComponent('Package', {
min-width: 0;
}

.copy-button {
clip: rect(0 0 0 0);
clip-path: inset(50%);
height: 1px;
overflow: hidden;
width: 1px;
transition:
opacity 0.25s 0.1s,
translate 0.15s 0.1s,
clip 0.01s 0.34s allow-discrete,
clip-path 0.01s 0.34s allow-discrete,
height 0.01s 0.34s allow-discrete,
width 0.01s 0.34s allow-discrete;
}

.group:hover .copy-button,
.copy-button:focus-visible {
clip: auto;
clip-path: none;
height: auto;
overflow: visible;
width: auto;
transition:
opacity 0.15s,
translate 0.15s;
}

@media (hover: none) {
.copy-button {
display: none;
Expand Down
Loading