fix: cursor-pointer shenanigans

This commit is contained in:
James Xylight committed 2025-06-06 11:39:40 -07:00
1 parent f3602a546b
commit 8fe9660bc5
2 files changed
+35 -23

No files matched your search

@@ -48,14 +48,19 @@
</script>
<div
class="h-full flex items-center overflow-hidden {buttonColor.ghost} rounded-full hover:bg-transparent font-medium"
class={[
'h-full flex items-center overflow-hidden rounded-full hover:bg-transparent font-medium',
buttonColor.ghost,
]}
>
<button
onclick={() => castVote(vote == 1 ? 0 : 1)}
class="flex items-center gap-0.5 transition-colors px-1.5 h-full
{vote == 1
? shouldShowVoteColor(vote, 'upvotes')
: 'hover:bg-slate-100 dark:hover:bg-zinc-800'}"
class={[
'flex items-center gap-0.5 transition-colors px-1.5 h-full cursor-pointer',
vote == 1
? shouldShowVoteColor(vote, 'upvotes')
: 'hover:bg-slate-100 dark:hover:bg-zinc-800',
]}
>
<Icon src={ChevronUp} size="18" mini />
<span class="grid text-sm">
@@ -75,10 +80,12 @@
></div>
<button
onclick={() => castVote(vote == -1 ? 0 : -1)}
class="flex flex-row-reverse items-center gap-0.5 h-full transition-colors border-0 px-1.5
{vote == -1
? shouldShowVoteColor(vote, 'downvotes')
: 'hover:bg-slate-100 dark:hover:bg-zinc-800'}"
class={[
'flex flex-row-reverse items-center gap-0.5 transition-colors px-1.5 h-full cursor-pointer',
vote == 1
? shouldShowVoteColor(vote, 'upvotes')
: 'hover:bg-slate-100 dark:hover:bg-zinc-800',
]}
>
<Icon src={ChevronDown} size="18" mini />
<span class="grid text-sm">
+19 -14
View File
@@ -72,21 +72,24 @@
{#if children}{@render children({ vote, score })}{:else}
<div
class="{buttonColor.ghost} rounded-full h-full font-medium flex items-center *:p-2
hover:bg-white dark:hover:bg-zinc-900 overflow-hidden transition-colors shrink-0
{vote != 0
? ''
: 'text-inherit!'} text-inherit! divide-x divide-slate-200 dark:divide-zinc-800
{loading ? 'animate-pulse opacity-75 pointer-events-none' : ''}"
class={[
buttonColor.ghost,
'rounded-full h-full font-medium flex items-center *:p-2',
'hover:bg-white dark:hover:bg-zinc-900 overflow-hidden transition-colors shrink-0',
'text-inherit! divide-x divide-slate-200 dark:divide-zinc-800',
loading && 'animate-pulse opacity-75 pointer-events-none',
]}
role="group"
aria-label={$t('aria.vote.group')}
>
<button
onclick={() => castVote(vote == 1 ? 0 : 1)}
class="flex items-center gap-0.5 transition-colors relative z-0
{vote == 1
? shouldShowVoteColor(vote, 'upvotes')
: 'hover:bg-slate-100 dark:hover:bg-zinc-800'}"
class={[
'flex items-center gap-0.5 transition-colors relative cursor-pointer',
vote == 1
? shouldShowVoteColor(vote, 'upvotes')
: 'hover:bg-slate-100 dark:hover:bg-zinc-800',
]}
aria-pressed={vote == 1}
aria-label={$t('post.actions.vote.upvote')}
>
@@ -109,10 +112,12 @@
{#if site.data?.site_view.local_site.enable_downvotes ?? true}
<button
onclick={() => castVote(vote == -1 ? 0 : -1)}
class="flex items-center flex-row-reverse gap-0.5 transition-colors
{vote == -1
? shouldShowVoteColor(vote, 'downvotes')
: 'hover:bg-slate-100 dark:hover:bg-zinc-800'}"
class={[
'flex items-center flex-row-reverse gap-0.5 transition-colors cursor-pointer',
vote == -1
? shouldShowVoteColor(vote, 'downvotes')
: 'hover:bg-slate-100 dark:hover:bg-zinc-800',
]}
aria-pressed={vote == -1}
aria-label={$t('post.actions.vote.downvote')}
>