impr: improve design consistency/rounding
This commit is contained in:
10 files changed
+65
-38
No files matched your search
@@ -147,7 +147,7 @@
|
|||||||
<button
|
<button
|
||||||
class={[
|
class={[
|
||||||
'row-span-2 shrink-0 mr-2 self-center group/btn',
|
'row-span-2 shrink-0 mr-2 self-center group/btn',
|
||||||
'bg-slate-200 dark:bg-zinc-800 rounded-md cursor-pointer',
|
'bg-slate-200 dark:bg-zinc-800 rounded-lg cursor-pointer',
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Avatar
|
<Avatar
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
buttonColor.ghost,
|
buttonColor.ghost,
|
||||||
'rounded-full h-full font-medium flex items-center *:p-2',
|
'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',
|
'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',
|
'text-inherit! divide-x divide-slate-200 dark:divide-zinc-800 shadow-xs',
|
||||||
loading && 'animate-pulse opacity-75 pointer-events-none',
|
loading && 'animate-pulse opacity-75 pointer-events-none',
|
||||||
]}
|
]}
|
||||||
role="group"
|
role="group"
|
||||||
|
|||||||
@@ -145,7 +145,7 @@
|
|||||||
<div
|
<div
|
||||||
class="flex flex-col border border-slate-200 border-b-slate-300 dark:border-t-zinc-700/70 dark:border-zinc-800
|
class="flex flex-col border border-slate-200 border-b-slate-300 dark:border-t-zinc-700/70 dark:border-zinc-800
|
||||||
focus-within:border-primary-900 dark:focus-within:border-primary-100 focus-within:ring-3 ring-slate-300
|
focus-within:border-primary-900 dark:focus-within:border-primary-100 focus-within:ring-3 ring-slate-300
|
||||||
dark:ring-zinc-700 rounded-xl
|
dark:ring-zinc-700 rounded-2xl
|
||||||
overflow-hidden transition-colors {clazz}"
|
overflow-hidden transition-colors {clazz}"
|
||||||
class:mt-1={label}
|
class:mt-1={label}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -65,17 +65,21 @@
|
|||||||
{alt}
|
{alt}
|
||||||
{width}
|
{width}
|
||||||
{title}
|
{title}
|
||||||
class={['aspect-square object-cover overflow-hidden shrink-0', clazz]}
|
class={[
|
||||||
|
'aspect-square object-cover overflow-hidden shrink-0',
|
||||||
|
circle ? 'rounded-full' : 'rounded-lg',
|
||||||
|
clazz,
|
||||||
|
]}
|
||||||
style="width: {width}px; height: {width}px; {style}"
|
style="width: {width}px; height: {width}px; {style}"
|
||||||
class:rounded-full={circle}
|
|
||||||
class:rounded-md={!circle}
|
|
||||||
/>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<div
|
<div
|
||||||
style="width: {width}px; height: {width}px;"
|
style="width: {width}px; height: {width}px;"
|
||||||
class={['aspect-square object-cover overflow-hidden shrink-0', clazz]}
|
class={[
|
||||||
class:rounded-full={circle}
|
'aspect-square object-cover overflow-hidden shrink-0',
|
||||||
class:rounded-md={!circle}
|
circle ? 'rounded-full' : 'rounded-lg',
|
||||||
|
clazz,
|
||||||
|
]}
|
||||||
>
|
>
|
||||||
{@html createAvatar(initials, {
|
{@html createAvatar(initials, {
|
||||||
seed: alt,
|
seed: alt,
|
||||||
|
|||||||
@@ -1,8 +1,16 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
const sizes = {
|
||||||
|
sm: 'text-2xl',
|
||||||
|
md: 'text-3xl',
|
||||||
|
lg: 'text-4xl',
|
||||||
|
xl: 'text-6xl',
|
||||||
|
}
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
pageHeader?: boolean
|
pageHeader?: boolean
|
||||||
style?: string
|
style?: string
|
||||||
class?: string
|
class?: string
|
||||||
|
size?: keyof typeof sizes
|
||||||
children?: import('svelte').Snippet
|
children?: import('svelte').Snippet
|
||||||
extended?: import('svelte').Snippet
|
extended?: import('svelte').Snippet
|
||||||
}
|
}
|
||||||
@@ -11,6 +19,7 @@
|
|||||||
pageHeader = false,
|
pageHeader = false,
|
||||||
style = '',
|
style = '',
|
||||||
class: clazz = '',
|
class: clazz = '',
|
||||||
|
size = 'lg',
|
||||||
children,
|
children,
|
||||||
extended,
|
extended,
|
||||||
}: Props = $props()
|
}: Props = $props()
|
||||||
@@ -26,7 +35,7 @@
|
|||||||
{style}
|
{style}
|
||||||
>
|
>
|
||||||
<h1
|
<h1
|
||||||
class="text-4xl flex gap-2 w-full tracking-tight font-medium {clazz ?? ''}"
|
class={[sizes[size], 'flex gap-2 w-full tracking-tight font-medium', clazz]}
|
||||||
>
|
>
|
||||||
{@render children?.()}
|
{@render children?.()}
|
||||||
</h1>
|
</h1>
|
||||||
|
|||||||
@@ -173,8 +173,8 @@
|
|||||||
buttonSize[size],
|
buttonSize[size],
|
||||||
buttonRounding[rounding][roundingSide],
|
buttonRounding[rounding][roundingSide],
|
||||||
buttonShadow[shadow],
|
buttonShadow[shadow],
|
||||||
'text-sm transition-all font-medium cursor-pointer duration-75 disabled:opacity-50 disabled:pointer-events-none',
|
'text-sm transition-all font-medium cursor-pointer duration-75 disabled:opacity-50 disabled:pointer-events-none disabled:shadow-none',
|
||||||
disabled && 'pointer-events-none opacity-50',
|
disabled && 'pointer-events-none opacity-50 shadow-none',
|
||||||
alignment == 'center'
|
alignment == 'center'
|
||||||
? 'origin-center'
|
? 'origin-center'
|
||||||
: alignment == 'left'
|
: alignment == 'left'
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
shadow = 'none',
|
shadow = 'none',
|
||||||
element = $bindable(),
|
element = $bindable(),
|
||||||
class: clazz = '',
|
class: clazz = '',
|
||||||
customLabel,
|
customLabel: passedCustomLabel,
|
||||||
prefix,
|
prefix,
|
||||||
suffix,
|
suffix,
|
||||||
children,
|
children,
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 {clazz}">
|
<div class="flex flex-col gap-1 {clazz}">
|
||||||
{#if customLabel || label}
|
{#if passedCustomLabel || label}
|
||||||
<Label
|
<Label
|
||||||
for={id}
|
for={id}
|
||||||
text={label}
|
text={label}
|
||||||
@@ -72,9 +72,7 @@
|
|||||||
? "after:content-['*'] after:text-red-500 after:ml-1"
|
? "after:content-['*'] after:text-red-500 after:ml-1"
|
||||||
: ''}"
|
: ''}"
|
||||||
>
|
>
|
||||||
{#snippet customLabel()}
|
{@render passedCustomLabel?.()}
|
||||||
{@render customLabel?.()}
|
|
||||||
{/snippet}
|
|
||||||
</Label>
|
</Label>
|
||||||
{/if}
|
{/if}
|
||||||
<div
|
<div
|
||||||
@@ -84,13 +82,13 @@
|
|||||||
`border focus-within:border-primary-900 dark:focus-within:border-primary-100 focus-within:ring-2
|
`border focus-within:border-primary-900 dark:focus-within:border-primary-100 focus-within:ring-2
|
||||||
ring-slate-300 dark:ring-zinc-700
|
ring-slate-300 dark:ring-zinc-700
|
||||||
transition-colors
|
transition-colors
|
||||||
rounded-lg flex flex-row items-center text-sm`,
|
rounded-xl flex flex-row items-center text-sm`,
|
||||||
clazz,
|
clazz,
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
{#if prefix}
|
{#if prefix}
|
||||||
<div
|
<div
|
||||||
class="rounded-lg rounded-r-none
|
class="rounded-xl rounded-r-none
|
||||||
text-slate-600 dark:text-zinc-400 {inlineAffixes
|
text-slate-600 dark:text-zinc-400 {inlineAffixes
|
||||||
? 'bg-white dark:bg-zinc-950 pr-0 w-8'
|
? 'bg-white dark:bg-zinc-950 pr-0 w-8'
|
||||||
: ''} {sizeClass[size]}"
|
: ''} {sizeClass[size]}"
|
||||||
@@ -109,7 +107,7 @@
|
|||||||
class={[
|
class={[
|
||||||
sizeClass[size],
|
sizeClass[size],
|
||||||
`bg-white dark:bg-zinc-950
|
`bg-white dark:bg-zinc-950
|
||||||
focus:outline-hidden rounded-lg text-sm w-full disabled:bg-slate-100
|
focus:outline-hidden rounded-xl text-sm w-full disabled:bg-slate-100
|
||||||
disabled:cursor-not-allowed dark:disabled:bg-zinc-950 invalid:border-red-500!
|
disabled:cursor-not-allowed dark:disabled:bg-zinc-950 invalid:border-red-500!
|
||||||
peer invalid:text-red-500 z-10`,
|
peer invalid:text-red-500 z-10`,
|
||||||
prefix && 'rounded-l-none',
|
prefix && 'rounded-l-none',
|
||||||
@@ -122,7 +120,7 @@
|
|||||||
{#if suffix}
|
{#if suffix}
|
||||||
<div
|
<div
|
||||||
class={[
|
class={[
|
||||||
'rounded-lg rounded-l-none text-slate-600 dark:text-zinc-400',
|
'rounded-xl rounded-l-none text-slate-600 dark:text-zinc-400',
|
||||||
inlineAffixes && 'bg-white dark:bg-zinc-950 pl-0',
|
inlineAffixes && 'bg-white dark:bg-zinc-950 pl-0',
|
||||||
sizeClass[size],
|
sizeClass[size],
|
||||||
]}
|
]}
|
||||||
|
|||||||
@@ -53,8 +53,8 @@
|
|||||||
|
|
||||||
{#if profile.data?.jwt}
|
{#if profile.data?.jwt}
|
||||||
{#if !commenting}
|
{#if !commenting}
|
||||||
<EndPlaceholder class="">
|
<EndPlaceholder>
|
||||||
<Button color="primary" onclick={() => (commenting = true)}>
|
<Button color="primary" rounding="xl" onclick={() => (commenting = true)}>
|
||||||
<Icon src={PlusCircle} size="16" micro />
|
<Icon src={PlusCircle} size="16" micro />
|
||||||
{$t('routes.post.addComment')}
|
{$t('routes.post.addComment')}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -74,7 +74,12 @@
|
|||||||
{$t('filter.sort.controversial')}
|
{$t('filter.sort.controversial')}
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
<Button size="square-md" onclick={onupdate}>
|
<Button
|
||||||
|
size="custom"
|
||||||
|
class="h-8.5 w-8.5"
|
||||||
|
rounding="xl"
|
||||||
|
onclick={onupdate}
|
||||||
|
>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={ArrowPath} size="16" mini />
|
<Icon src={ArrowPath} size="16" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -122,7 +127,7 @@
|
|||||||
{$t('filter.sort.controversial')}
|
{$t('filter.sort.controversial')}
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
<Button size="square-md" onclick={onupdate}>
|
<Button size="custom" class="h-8.5 w-8.5" rounding="xl" onclick={onupdate}>
|
||||||
{#snippet prefix()}
|
{#snippet prefix()}
|
||||||
<Icon src={ArrowPath} size="16" mini />
|
<Icon src={ArrowPath} size="16" mini />
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -163,8 +163,11 @@
|
|||||||
<Material
|
<Material
|
||||||
color="transparent"
|
color="transparent"
|
||||||
class="items-center gap-x-4 color-grid gap-y-2"
|
class="items-center gap-x-4 color-grid gap-y-2"
|
||||||
|
rounding="2xl"
|
||||||
>
|
>
|
||||||
<h1 class="text-2xl font-bold col-span-2">{$t('routes.theme.accent')}</h1>
|
<Header size="sm" style="grid-column: span 2 / span 2;">
|
||||||
|
{$t('routes.theme.accent')}
|
||||||
|
</Header>
|
||||||
<ColorSwatch
|
<ColorSwatch
|
||||||
value={themeData.current.colors.primary?.[900]}
|
value={themeData.current.colors.primary?.[900]}
|
||||||
onchange={e => {
|
onchange={e => {
|
||||||
@@ -191,17 +194,27 @@
|
|||||||
}}
|
}}
|
||||||
class="w-12! h-12! col-span-1"
|
class="w-12! h-12! col-span-1"
|
||||||
/>
|
/>
|
||||||
<span class="font-semibold text-base">
|
<span class="font-medium text-sm -mt-2">
|
||||||
{$t('nav.menu.colorscheme.light')}
|
{$t('nav.menu.colorscheme.light')}
|
||||||
</span>
|
</span>
|
||||||
<span class="font-semibold text-base">
|
<span class="font-medium text-sm -mt-2">
|
||||||
{$t('nav.menu.colorscheme.dark')}
|
{$t('nav.menu.colorscheme.dark')}
|
||||||
</span>
|
</span>
|
||||||
</Material>
|
</Material>
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2">
|
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 mt-4">
|
||||||
{#each Object.entries(defaultColors) as [category, value] (category)}
|
{#each Object.entries(defaultColors) as [category, value] (category)}
|
||||||
<Material color="transparent" class="flex flex-col gap-2">
|
<Material
|
||||||
<h1 class="capitalize font-semibold text-lg">{category}</h1>
|
rounding="2xl"
|
||||||
|
color="transparent"
|
||||||
|
class="flex flex-col gap-2"
|
||||||
|
>
|
||||||
|
<Header
|
||||||
|
class="capitalize"
|
||||||
|
size="sm"
|
||||||
|
style="grid-column: span 2 / span 2;"
|
||||||
|
>
|
||||||
|
{category}
|
||||||
|
</Header>
|
||||||
<div class="flex flex-row gap-1 flex-wrap items-center space-evenly">
|
<div class="flex flex-row gap-1 flex-wrap items-center space-evenly">
|
||||||
{#each Object.entries(value) as [shade] (shade)}
|
{#each Object.entries(value) as [shade] (shade)}
|
||||||
<div class="flex flex-col gap-0.5 w-10 group">
|
<div class="flex flex-col gap-0.5 w-10 group">
|
||||||
@@ -219,7 +232,7 @@
|
|||||||
return true
|
return true
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<span class="font-medium capitalize">{shade}</span>
|
<span class="font-medium -mt-1 capitalize">{shade}</span>
|
||||||
</div>
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,20 +19,17 @@
|
|||||||
class="{theme.id == themeData.data.currentTheme
|
class="{theme.id == themeData.data.currentTheme
|
||||||
? 'ring-2 ring-inset ring-primary-900 dark:ring-primary-100'
|
? 'ring-2 ring-inset ring-primary-900 dark:ring-primary-100'
|
||||||
: ''} flex relative cursor-pointer h-full flex-col text-left p-0.5"
|
: ''} flex relative cursor-pointer h-full flex-col text-left p-0.5"
|
||||||
rounding="xl"
|
rounding="2xl"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class={[
|
class={[
|
||||||
'h-20 w-full rounded-lg rounded-b-none flex flex-row flex-wrap p-3 gap-2',
|
'h-20 w-full rounded-2xl rounded-b-none flex flex-row flex-wrap p-3 gap-2',
|
||||||
]}
|
]}
|
||||||
style="background-color: rgb({theme.colors[
|
style="background-color: rgb({theme.colors[
|
||||||
'zinc'
|
'zinc'
|
||||||
][900]}); color: rgb({theme.colors['zinc'][50]});"
|
][900]}); color: rgb({theme.colors['zinc'][50]});"
|
||||||
>
|
>
|
||||||
<div
|
<div style="color: rgb({theme.colors['zinc'][50]})" class="text-xs">
|
||||||
style="background-color: rgb({theme.colors['zinc'][50]})"
|
|
||||||
class="text-xs"
|
|
||||||
>
|
|
||||||
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@@ -73,6 +70,7 @@
|
|||||||
color="ghost"
|
color="ghost"
|
||||||
size="square-md"
|
size="square-md"
|
||||||
class="shrink-0"
|
class="shrink-0"
|
||||||
|
rounding="xl"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
modal({
|
modal({
|
||||||
actions: [
|
actions: [
|
||||||
|
|||||||
Reference in new issue
Block a user