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