design: improve spacing for ItemList
This commit is contained in:
3 files changed
+15
-3
No files matched your search
@@ -238,7 +238,7 @@
|
|||||||
color="uniform"
|
color="uniform"
|
||||||
rounding="2xl"
|
rounding="2xl"
|
||||||
elevation="high"
|
elevation="high"
|
||||||
class="max-w-2xl w-full max-h-128 overflow-auto"
|
class="max-w-2xl w-screen max-h-128 overflow-auto"
|
||||||
data-autoclose="false"
|
data-autoclose="false"
|
||||||
>
|
>
|
||||||
{#await import('../community/CommunityHeader.svelte') then { default: CommunityHeader }}
|
{#await import('../community/CommunityHeader.svelte') then { default: CommunityHeader }}
|
||||||
|
|||||||
@@ -19,7 +19,8 @@
|
|||||||
<CommonList animate={false} class="px-1 py-0.5" size="xs" {items}>
|
<CommonList animate={false} class="px-1 py-0.5" size="xs" {items}>
|
||||||
{#snippet item(item)}
|
{#snippet item(item)}
|
||||||
<Button
|
<Button
|
||||||
class="font-normal w-full h-max block"
|
class="font-normal w-full h-max block gap-2"
|
||||||
|
gap="lg"
|
||||||
color="none"
|
color="none"
|
||||||
alignment="left"
|
alignment="left"
|
||||||
href={item.url}
|
href={item.url}
|
||||||
@@ -30,6 +31,7 @@
|
|||||||
alt={item.name}
|
alt={item.name}
|
||||||
title={item.name}
|
title={item.name}
|
||||||
width={24}
|
width={24}
|
||||||
|
circle={false}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col max-w-full break-words">
|
<div class="flex flex-col max-w-full break-words">
|
||||||
|
|||||||
@@ -69,6 +69,14 @@
|
|||||||
}
|
}
|
||||||
type ButtonWeight = keyof typeof buttonWeight
|
type ButtonWeight = keyof typeof buttonWeight
|
||||||
|
|
||||||
|
const buttonGap = {
|
||||||
|
xl: 'gap-3',
|
||||||
|
lg: 'gap-2',
|
||||||
|
md: 'gap-1.5',
|
||||||
|
none: '',
|
||||||
|
}
|
||||||
|
type ButtonGap = keyof typeof buttonGap
|
||||||
|
|
||||||
interface Props
|
interface Props
|
||||||
extends Omit<HTMLButtonAttributes | HTMLAnchorAttributes, 'prefix'> {
|
extends Omit<HTMLButtonAttributes | HTMLAnchorAttributes, 'prefix'> {
|
||||||
loading?: boolean
|
loading?: boolean
|
||||||
@@ -79,6 +87,7 @@
|
|||||||
rounding?: ButtonRoundness
|
rounding?: ButtonRoundness
|
||||||
alignment?: ButtonAlignment
|
alignment?: ButtonAlignment
|
||||||
shadow?: ButtonShadow
|
shadow?: ButtonShadow
|
||||||
|
gap?: ButtonGap
|
||||||
loaderWidth?: number | undefined
|
loaderWidth?: number | undefined
|
||||||
href?: string | undefined
|
href?: string | undefined
|
||||||
class?: ClassValue
|
class?: ClassValue
|
||||||
@@ -103,6 +112,7 @@
|
|||||||
rounding = size == 'lg' || size == 'square-lg' ? '2xl' : 'xl',
|
rounding = size == 'lg' || size == 'square-lg' ? '2xl' : 'xl',
|
||||||
alignment = 'center',
|
alignment = 'center',
|
||||||
shadow = color == 'primary' || color == 'secondary' ? 'sm' : 'none',
|
shadow = color == 'primary' || color == 'secondary' ? 'sm' : 'none',
|
||||||
|
gap = 'md',
|
||||||
disabled,
|
disabled,
|
||||||
loaderWidth = undefined,
|
loaderWidth = undefined,
|
||||||
href = undefined,
|
href = undefined,
|
||||||
@@ -130,6 +140,7 @@
|
|||||||
buttonColor[color],
|
buttonColor[color],
|
||||||
buttonAlignment[alignment],
|
buttonAlignment[alignment],
|
||||||
buttonWeight[weight],
|
buttonWeight[weight],
|
||||||
|
buttonGap[gap],
|
||||||
(disabled || loading) && 'btn-disabled',
|
(disabled || loading) && 'btn-disabled',
|
||||||
alignment == 'center'
|
alignment == 'center'
|
||||||
? 'origin-center'
|
? 'origin-center'
|
||||||
@@ -172,7 +183,6 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: var(--text-sm);
|
font-size: var(--text-sm);
|
||||||
gap: calc(var(--spacing) * 1.5);
|
|
||||||
|
|
||||||
transition: 75ms cubic-bezier(0.075, 0.82, 0.165, 1);
|
transition: 75ms cubic-bezier(0.075, 0.82, 0.165, 1);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user