design: redesign Tabs and distinct material, improve button danger style
This commit is contained in:
12 files changed
+185
-84
No files matched your search
@@ -294,14 +294,17 @@
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
/* border border-red-500 bg-red-500 hover:text-red-500 hover:bg-transparent text-white */
|
||||
|
||||
background-color: var(--color-red-600);
|
||||
background: linear-gradient(to bottom, var(--color-red-400), var(--color-red-500));
|
||||
border: 1px solid var(--color-red-600);
|
||||
box-shadow:
|
||||
0px 1.5px 0px 0px inset --alpha(var(--color-red-50) / 50%),
|
||||
0px -1px 0px 0px inset --alpha(var(--color-red-900) / 50%);
|
||||
color: var(--color-white);
|
||||
|
||||
@variant dark {
|
||||
background-color: var(--color-red-400);
|
||||
background: linear-gradient(to bottom, var(--color-red-300), var(--color-red-400));
|
||||
color: var(--color-black);
|
||||
border: 1px solid var(--color-red-900);
|
||||
}
|
||||
|
||||
@variant hover {
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
id?: string
|
||||
rows?: number
|
||||
element?: HTMLTextAreaElement | undefined
|
||||
unstyled?: boolean
|
||||
class?: ClassValue
|
||||
customLabel?: import('svelte').Snippet
|
||||
suffix?: import('svelte').Snippet
|
||||
@@ -45,6 +46,7 @@
|
||||
id = generateID(),
|
||||
rows = 4,
|
||||
element = $bindable(),
|
||||
unstyled = false,
|
||||
class: clazz = '',
|
||||
customLabel,
|
||||
suffix,
|
||||
@@ -65,9 +67,8 @@
|
||||
{@render customLabel?.()}
|
||||
</Label>
|
||||
{/if}
|
||||
<div
|
||||
class="rounded-xl flex flex-col items-center text-sm bg-white dark:bg-zinc-950 {clazz}"
|
||||
>
|
||||
<div class={[!unstyled && 'text-area-container', clazz]}>
|
||||
e button danger style)
|
||||
<textarea
|
||||
{id}
|
||||
{placeholder}
|
||||
@@ -78,12 +79,9 @@
|
||||
{...rest}
|
||||
class={[
|
||||
sizeClass[size],
|
||||
borderClass,
|
||||
`focus:border-slate-800 dark:focus:border-zinc-200 bg-white dark:bg-zinc-950
|
||||
focus:outline-hidden focus:ring-2 ring-slate-800/50 rounded-xl dark:ring-zinc-200/50
|
||||
transition-all text-sm w-full disabled:bg-slate-100
|
||||
disabled:cursor-not-allowed dark:disabled:bg-zinc-900 invalid:border-red-500!
|
||||
peer invalid:text-red-500 z-10`,
|
||||
'text-area transition-all peer',
|
||||
!unstyled && borderClass,
|
||||
!unstyled && 'focus:ring-2 ring-slate-800/50 dark:ring-zinc-200/50',
|
||||
suffix && 'rounded-b-none border-b-0',
|
||||
clazz,
|
||||
]}
|
||||
@@ -101,3 +99,58 @@
|
||||
</div>
|
||||
{@render children?.()}
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@reference '../../../../app.css';
|
||||
.text-area-container {
|
||||
border-radius: var(--radius-xl);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-size: var(--text-sm);
|
||||
|
||||
background: linear-gradient(
|
||||
to top,
|
||||
var(--color-white),
|
||||
var(--color-slate-100)
|
||||
);
|
||||
|
||||
@variant dark {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.text-area {
|
||||
border-radius: inherit;
|
||||
width: 100%;
|
||||
|
||||
@variant focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
@variant disabled {
|
||||
cursor: not-allowed;
|
||||
background-color: var(--color-slate-100);
|
||||
|
||||
@variant dark {
|
||||
background: var(--color-zinc-900);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -86,7 +86,12 @@
|
||||
]}
|
||||
>
|
||||
{#if icon}
|
||||
<Icon src={icon} size="20" mini class="inline-block rounded-lg clear-both float-left mr-2" />
|
||||
<Icon
|
||||
src={icon}
|
||||
size="20"
|
||||
mini
|
||||
class="inline-block rounded-lg clear-both float-left mr-2"
|
||||
/>
|
||||
{/if}
|
||||
{@render children?.()}
|
||||
</svelte:element>
|
||||
@@ -130,8 +135,7 @@
|
||||
|
||||
.material-distinct {
|
||||
background-color: --alpha(var(--color-slate-50) / 70%);
|
||||
border-width: 1px;
|
||||
border-color: var(--color-slate-200);
|
||||
border: 1px solid var(--color-slate-200);
|
||||
box-shadow: 0px 1.5px 0px 0px --alpha(var(--color-white) / 90%) inset;
|
||||
|
||||
@variant not-dark {
|
||||
@@ -139,9 +143,13 @@
|
||||
}
|
||||
|
||||
@variant dark {
|
||||
background-color: --alpha(var(--color-zinc-925) / 70%);
|
||||
border-color: --alpha(var(--color-black) / 30%);
|
||||
box-shadow: 0px 1.5px 0px 0px --alpha(var(--color-zinc-800) / 80%) inset;
|
||||
background: linear-gradient(
|
||||
to bottom,
|
||||
var(--color-zinc-800),
|
||||
var(--color-zinc-900)
|
||||
);
|
||||
border-color: oklab(0.2 0 00%);
|
||||
box-shadow: 0px 1.5px 0px 0px --alpha(var(--color-zinc-700) / 80%) inset;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,12 +168,10 @@
|
||||
}
|
||||
|
||||
.material-uniform {
|
||||
background-color: white;
|
||||
border-width: 1px;
|
||||
border-color: var(--color-slate-200);
|
||||
|
||||
@variant dark {
|
||||
background-color: var(--color-zinc-950);
|
||||
border-color: var(--color-zinc-900);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user