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
+32 -20

No files matched your search

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