design: tweak border radius because a single person has a bad opinion
This commit is contained in:
2 files changed
+9
-13
No files matched your search
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" module>
|
||||
export const voteColor = (vote: number) =>
|
||||
vote == 1
|
||||
? `btn-primary border-0!`
|
||||
? `btn-primary border-0! border border-transparent`
|
||||
: vote == -1
|
||||
? `bg-red-500 text-slate-50 dark:bg-red-400 dark:text-zinc-900`
|
||||
: ''
|
||||
@@ -23,7 +23,7 @@
|
||||
import { t } from '$lib/app/i18n'
|
||||
import { settings } from '$lib/app/settings.svelte'
|
||||
import FormattedNumber from '$lib/ui/util/FormattedNumber.svelte'
|
||||
import { buttonColor, toast } from 'mono-svelte'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons/dist'
|
||||
import { backOut } from 'svelte/easing'
|
||||
import { fly } from 'svelte/transition'
|
||||
@@ -93,14 +93,14 @@
|
||||
<button
|
||||
onclick={() => castVote(vote == targetNum ? 0 : targetNum)}
|
||||
class={[
|
||||
'flex items-center gap-0.5 transition-colors relative cursor-pointer h-full p-2',
|
||||
'flex items-center gap-0.5 transition-colors relative cursor-pointer h-full p-2 first:border-r-0! first:rounded-l-[inherit] last:rounded-r-[inherit]',
|
||||
'last:flex-row-reverse',
|
||||
vote == targetNum
|
||||
? shouldShowVoteColor(
|
||||
vote,
|
||||
target == 'upvote' ? 'upvotes' : 'downvotes',
|
||||
)
|
||||
: 'btn-tertiary',
|
||||
: 'btn-secondary',
|
||||
]}
|
||||
aria-pressed={vote == targetNum}
|
||||
aria-label={$t(
|
||||
@@ -136,17 +136,13 @@
|
||||
)}
|
||||
<div
|
||||
class={[
|
||||
buttonColor.secondary,
|
||||
'rounded-xl h-full font-medium flex relative hover:bg-transparent! overflow-hidden',
|
||||
'rounded-xl h-full font-medium flex relative overflow-hidden',
|
||||
voteRatio < 85 && settings.voteRatioBar && 'vote-ratio',
|
||||
]}
|
||||
aria-label={$t('aria.vote.group')}
|
||||
style="--vote-ratio: {voteRatio}%;"
|
||||
>
|
||||
{@render voteButton(upvotes, 'upvote', vote)}
|
||||
<div
|
||||
class="h-full p-0! border-l border-slate-200 dark:border-zinc-800"
|
||||
></div>
|
||||
{#if site.data?.site_view.local_site.enable_downvotes ?? true}
|
||||
{@render voteButton(downvotes, 'downvote', vote)}
|
||||
{/if}
|
||||
|
||||
Reference in new issue
Block a user