design: Ruin photon (add depth to buttons/text inputs, tweak commonlist)

This commit is contained in:
Xylight committed 2026-05-13 19:39:31 -07:00
1 parent f2a3a89ea9
commit b7ede17ea5
10 files changed
+163 -146

No files matched your search

+9 -16
View File
@@ -51,30 +51,23 @@
<style>
@reference '../../../app.css';
ul {
:global {
li:not(:last-child) {
margin-block-start: calc(calc(var(--spacing) * 1));
margin-block-end: calc(calc(var(--spacing) * 1));
}
}
}
ul :global(li:not(ul li li)) {
transition: background-color 0.1s;
background-color: var(--color-white);
container-type: inline-size;
border: 1px solid
color-mix(in oklab, var(--color-slate-50), var(--color-slate-100));
border-radius: var(--radius-lg) var(--radius-lg);
border-left: 1px solid var(--color-slate-100);
border-right: 1px solid var(--color-slate-100);
&:first-of-type {
border-top-left-radius: var(--radius-2xl);
border-top-right-radius: var(--radius-2xl);
border-top-left-radius: var(--radius-3xl);
border-top-right-radius: var(--radius-3xl);
border-top: 1px solid var(--color-slate-100);
}
border-bottom: 1px solid var(--color-slate-100);
&:last-of-type {
border-bottom-left-radius: var(--radius-2xl);
border-bottom-right-radius: var(--radius-2xl);
border-bottom-left-radius: var(--radius-3xl);
border-bottom-right-radius: var(--radius-3xl);
}
&:hover {
+24 -9
View File
@@ -20,10 +20,13 @@
tertiary: 'btn-tertiary',
danger: 'btn-danger',
ghost: 'btn-ghost',
'danger-subtle': 'text-red-500 hover:bg-red-500 hover:text-inherit!',
'success-subtle': 'text-green-500 hover:bg-green-500 hover:text-inherit!',
'warning-subtle': 'text-yellow-500 hover:bg-yellow-500 hover:text-inherit!',
'blue-subtle': `text-blue-500 hover:bg-blue-500 hover:text-inherit!`,
'danger-subtle':
'text-red-500 dark:text-red-400 hover:bg-red-500 hover:dark:bg-red-400 hover:text-inherit!',
'success-subtle':
'text-green-500 dark:text-green-400 hover:bg-green-500 hover:dark:bg-green-400 hover:text-inherit!',
'warning-subtle':
'text-yellow-500 dark:text-yellow-400 hover:bg-yellow-500 hover:dark:bg-yellow-400 hover:text-inherit!',
'blue-subtle': `text-blue-500 dark:text-yellow-400 hover:bg-blue-500 hover:dark:bg-blue-400 hover:text-inherit!`,
none: '',
}
@@ -233,23 +236,35 @@
@variant dark {
border: 1px solid
color-mix(
in oklab,
var(--color-zinc-800) 80%,
var(--color-zinc-900) 20%
);
background: linear-gradient(
to bottom,
color-mix(
in oklab,
var(--color-zinc-800) 50%,
var(--color-zinc-900) 50%
);
background-color: var(--color-zinc-900);
border-top-color: var(--color-zinc-800);
),
var(--color-zinc-900)
);
border-top-color: color-mix(
in oklab,
var(--color-zinc-700) 50%,
var(--color-zinc-800) 50%
);
}
@variant hover {
background-color: color-mix(
background: color-mix(
in oklab,
var(--color-white),
var(--color-slate-50)
);
@variant dark {
background-color: color-mix(
background: color-mix(
in oklab,
var(--color-zinc-925),
var(--color-zinc-900)
+3 -1
View File
@@ -1,8 +1,10 @@
<script lang="ts">
import type { ClassValue } from 'svelte/elements'
interface Props {
checked?: boolean
labelClass?: string
class?: string
class?: ClassValue
children?: import('svelte').Snippet
description?: import('svelte').Snippet
}
+82 -17
View File
@@ -40,8 +40,6 @@
</script>
<script lang="ts">
const borderClass = `border border-slate-200 border-b-slate-300 dark:border-zinc-800`
let {
label,
value = $bindable(),
@@ -52,7 +50,7 @@
id = generateID(),
icon,
inlineAffixes = !!icon,
shadow = 'sm',
shadow = 'none',
element = $bindable(),
class: clazz = '',
customLabel: passedCustomLabel,
@@ -63,7 +61,7 @@
}: Props = $props()
</script>
<div class="flex flex-col gap-1 {clazz}">
<div class={['text-input-container', clazz]}>
{#if passedCustomLabel || label}
<Label
for={id}
@@ -79,20 +77,14 @@
<div
class={[
shadowClass[shadow],
borderClass,
`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-xl flex flex-row items-center text-sm`,
'text-input-sections focus-within:ring-2 ring-slate-300 dark:ring-zinc-700 transition-colors',
clazz,
]}
>
{#if prefix || icon}
<div
class={[
'rounded-xl rounded-r-none text-slate-600 dark:text-zinc-400',
inlineAffixes &&
'bg-white dark:bg-zinc-900 pr-0 px-3 h-full flex items-center',
'rounded-xl rounded-r-none text-slate-600 dark:text-zinc-400 pl-3',
]}
>
{#if prefix}
@@ -113,10 +105,7 @@
{...rest}
class={[
sizeClass[size],
`bg-white dark:bg-zinc-900
focus:outline-hidden rounded-xl text-sm w-full disabled:bg-slate-100
disabled:cursor-not-allowed dark:disabled:bg-zinc-800 invalid:border-red-500!
peer invalid:text-red-500 z-10`,
'text-input flex-1',
(prefix || icon) && 'rounded-l-none',
(prefix || icon) && inlineAffixes && 'border-l-0',
suffix && 'rounded-r-none',
@@ -128,7 +117,6 @@
<div
class={[
'rounded-xl rounded-l-none text-slate-600 dark:text-zinc-400 h-full',
inlineAffixes && 'bg-white dark:bg-zinc-900 pl-0',
]}
>
{@render suffix?.()}
@@ -137,3 +125,80 @@
</div>
{@render children?.()}
</div>
<style>
@reference '../../../../app.css';
.text-input-container {
display: flex;
flex-direction: column;
gap: calc(var(--spacing) * 1);
*:focus {
outline: none;
}
}
.text-input-sections {
border: 1px solid var(--color-slate-200);
border-top-color: color-mix(
in oklab,
var(--color-slate-200),
var(--color-slate-300)
);
background: linear-gradient(
to top,
var(--color-white),
var(--color-slate-100)
);
border-radius: var(--radius-xl);
display: flex;
flex-direction: row;
align-items: center;
font-weight: var(--text-sm);
@variant dark {
border-color: var(--color-zinc-800);
border-bottom-color: var(--color-zinc-700);
background: linear-gradient(
to bottom,
var(--color-zinc-900),
color-mix(
in oklab,
var(--color-zinc-800) 50%,
var(--color-zinc-900) 50%
)
);
}
@variant focus-within {
border-color: var(--color-primary-900);
@variant dark {
border-color: var(--color-primary-100);
}
@variant has-invalid {
border-color: var(--color-red-500);
}
}
}
.text-input {
border-radius: var(--radius-xl);
font-size: var(--text-sm);
z-index: 10;
@variant disabled {
background: var(--color-slate-100);
@variant dark {
background: var(--color-zinc-800);
}
}
@variant invalid {
color: var(--color-red-500);
}
}
</style>
+3 -3
View File
@@ -42,15 +42,15 @@
{target}
{...rest}
bind:open
popoverClass="rounded-xl w-full backdrop-blur-md max-w-72"
popoverClass="rounded-xl w-full backdrop-blur-xl max-w-72"
>
{#snippet popover()}
<div
class="w-full max-w-sm max-h-128 overflow-auto list-none shadow-lg rounded-xl select-none"
>
<div
class="flex flex-col p-1 list-none bg-white/80 dark:bg-zinc-900/90 rounded-xl
border border-slate-200 dark:border-zinc-800 gap-px"
class="flex flex-col p-1 list-none bg-white/60 dark:bg-zinc-900/60 rounded-xl
border border-slate-200 dark:border-zinc-800 dark:border-t-zinc-700 not-dark:border-b-slate-300 gap-px"
role="menu"
>
{@render children?.(open)}
+1 -1
View File
@@ -182,7 +182,7 @@
placeholder={DEFAULT_INSTANCE_URL}
disabled={LINKED_INSTANCE_URL != undefined}
bind:value={form.instance}
class="flex-1 overflow-hidden"
class="flex-1"
required
pattern={DOMAIN_REGEX_FORMS}
autocorrect="off"
+1 -1
View File
@@ -114,7 +114,7 @@
bind:value={form.instance}
pattern={DOMAIN_REGEX_FORMS}
placeholder="example.com"
class="flex-1 overflow-hidden"
class="flex-1"
autocorrect="off"
autocapitalize="none"
>
+8 -12
View File
@@ -41,7 +41,11 @@
if (importText == '') {
throw new Error('import failed')
}
themeData.current.colors = JSON.parse(importText)
themeData.data.themes.push({
colors: JSON.parse(importText),
id: Math.max(...themeData.data.themes.map((i) => i.id)) + 1,
name: 'Imported theme',
})
toast({ content: $t('message.success'), type: 'success' })
importing = false
} catch (err) {
@@ -65,7 +69,6 @@
importing = !importing
}}
size="lg"
disabled={themeData.current.id <= 0}
icon={ArrowDownTray}
>
{$t('settings.import')}
@@ -75,7 +78,7 @@
navigator.clipboard.writeText(
JSON.stringify(themeData.current.colors),
)
toast({ content: 'Copied theme to clipboard.' })
toast({ content: 'Copied theme preset to clipboard.' })
}}
size="lg"
icon={ArrowUpTray}
@@ -148,16 +151,9 @@
themeData.data.currentTheme = newTheme.id
}}
>
<Material
color="none"
padding="sm"
class="border-dashed border-2 border-slate-400 dark:border-zinc-600
text-slate-400 dark:text-zinc-600 hover:border-slate-600 dark:hover:border-zinc-400
grid place-items-center w-14 h-14"
rounding="xl"
>
<Button rounding="xl" size="square-xl">
<Icon src={Plus} size="28" />
</Material>
</Button>
</button>
</div>
</Material>