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>
|
<script lang="ts" module>
|
||||||
export const voteColor = (vote: number) =>
|
export const voteColor = (vote: number) =>
|
||||||
vote == 1
|
vote == 1
|
||||||
? `btn-primary border-0!`
|
? `btn-primary border-0! border border-transparent`
|
||||||
: vote == -1
|
: vote == -1
|
||||||
? `bg-red-500 text-slate-50 dark:bg-red-400 dark:text-zinc-900`
|
? `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 { t } from '$lib/app/i18n'
|
||||||
import { settings } from '$lib/app/settings.svelte'
|
import { settings } from '$lib/app/settings.svelte'
|
||||||
import FormattedNumber from '$lib/ui/util/FormattedNumber.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 { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons/dist'
|
||||||
import { backOut } from 'svelte/easing'
|
import { backOut } from 'svelte/easing'
|
||||||
import { fly } from 'svelte/transition'
|
import { fly } from 'svelte/transition'
|
||||||
@@ -93,14 +93,14 @@
|
|||||||
<button
|
<button
|
||||||
onclick={() => castVote(vote == targetNum ? 0 : targetNum)}
|
onclick={() => castVote(vote == targetNum ? 0 : targetNum)}
|
||||||
class={[
|
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',
|
'last:flex-row-reverse',
|
||||||
vote == targetNum
|
vote == targetNum
|
||||||
? shouldShowVoteColor(
|
? shouldShowVoteColor(
|
||||||
vote,
|
vote,
|
||||||
target == 'upvote' ? 'upvotes' : 'downvotes',
|
target == 'upvote' ? 'upvotes' : 'downvotes',
|
||||||
)
|
)
|
||||||
: 'btn-tertiary',
|
: 'btn-secondary',
|
||||||
]}
|
]}
|
||||||
aria-pressed={vote == targetNum}
|
aria-pressed={vote == targetNum}
|
||||||
aria-label={$t(
|
aria-label={$t(
|
||||||
@@ -136,17 +136,13 @@
|
|||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
class={[
|
class={[
|
||||||
buttonColor.secondary,
|
'rounded-xl h-full font-medium flex relative overflow-hidden',
|
||||||
'rounded-xl h-full font-medium flex relative hover:bg-transparent! overflow-hidden',
|
|
||||||
voteRatio < 85 && settings.voteRatioBar && 'vote-ratio',
|
voteRatio < 85 && settings.voteRatioBar && 'vote-ratio',
|
||||||
]}
|
]}
|
||||||
aria-label={$t('aria.vote.group')}
|
aria-label={$t('aria.vote.group')}
|
||||||
style="--vote-ratio: {voteRatio}%;"
|
style="--vote-ratio: {voteRatio}%;"
|
||||||
>
|
>
|
||||||
{@render voteButton(upvotes, 'upvote', vote)}
|
{@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}
|
{#if site.data?.site_view.local_site.enable_downvotes ?? true}
|
||||||
{@render voteButton(downvotes, 'downvote', vote)}
|
{@render voteButton(downvotes, 'downvote', vote)}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
@@ -60,14 +60,14 @@
|
|||||||
border-right: 1px solid var(--color-slate-100);
|
border-right: 1px solid var(--color-slate-100);
|
||||||
|
|
||||||
&:first-of-type {
|
&:first-of-type {
|
||||||
border-top-left-radius: var(--radius-3xl);
|
border-top-left-radius: var(--radius-2xl);
|
||||||
border-top-right-radius: var(--radius-3xl);
|
border-top-right-radius: var(--radius-2xl);
|
||||||
border-top: 1px solid var(--color-slate-100);
|
border-top: 1px solid var(--color-slate-100);
|
||||||
}
|
}
|
||||||
border-bottom: 1px solid var(--color-slate-100);
|
border-bottom: 1px solid var(--color-slate-100);
|
||||||
&:last-of-type {
|
&:last-of-type {
|
||||||
border-bottom-left-radius: var(--radius-3xl);
|
border-bottom-left-radius: var(--radius-2xl);
|
||||||
border-bottom-right-radius: var(--radius-3xl);
|
border-bottom-right-radius: var(--radius-2xl);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|||||||
Reference in new issue
Block a user