design: improve click response and visual coherency
This commit is contained in:
12 files changed
+117
-83
No files matched your search
@@ -1,8 +1,8 @@
|
||||
<script lang="ts">
|
||||
import { tick } from 'svelte'
|
||||
import type { HTMLAttributes } from 'svelte/elements'
|
||||
import type { ClassValue, HTMLTextareaAttributes } from 'svelte/elements'
|
||||
|
||||
let textarea: HTMLTextAreaElement | undefined = $state()
|
||||
let textarea = $state<HTMLTextAreaElement>()
|
||||
|
||||
async function adjustHeight() {
|
||||
await tick()
|
||||
@@ -11,11 +11,11 @@
|
||||
textarea.style.height = `${textarea.scrollHeight}px` // Set height to the scrollHeight
|
||||
}
|
||||
}
|
||||
interface Props extends HTMLAttributes<HTMLTextAreaElement> {
|
||||
interface Props extends HTMLTextareaAttributes {
|
||||
label?: string | undefined
|
||||
value: string
|
||||
required?: boolean
|
||||
class?: string
|
||||
class?: ClassValue
|
||||
}
|
||||
|
||||
let {
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
@variant md {
|
||||
width: max-content;
|
||||
height: max-content;
|
||||
padding: calc(var(--spacing) * 1.25) calc(var(--spacing) * 3);
|
||||
padding: calc(var(--spacing) * 1.125) calc(var(--spacing) * 3);
|
||||
|
||||
@variant hover {
|
||||
background-color: --alpha(var(--color-slate-200) / 50%);
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
size = 'md',
|
||||
rounding = size == 'lg' || size == 'square-lg' ? '2xl' : 'xl',
|
||||
alignment = 'center',
|
||||
shadow = color == 'primary' || color == 'secondary' ? 'sm' : 'none',
|
||||
shadow = 'none',
|
||||
gap = 'md',
|
||||
disabled,
|
||||
loaderWidth = undefined,
|
||||
@@ -230,8 +230,14 @@
|
||||
background-color: var(--color-white);
|
||||
|
||||
@variant dark {
|
||||
border: 1px solid var(--color-zinc-800);
|
||||
border: 1px solid
|
||||
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);
|
||||
}
|
||||
|
||||
@variant hover {
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
<style>
|
||||
.btn-group {
|
||||
gap: var(--spacing);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -41,14 +40,18 @@
|
||||
& > button,
|
||||
& > a {
|
||||
position: relative;
|
||||
border-radius: 8px !important;
|
||||
|
||||
&:first-child {
|
||||
border-radius: 24px 12px 12px 24px !important;
|
||||
&:not(:first-child):not(:last-child) {
|
||||
border-radius: 0px !important;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-radius: 12px 24px 24px 12px !important;
|
||||
&:first-child:not(:last-child) {
|
||||
border-radius: var(--radius-xl) 0px 0px var(--radius-xl) !important;
|
||||
border-right: 0px;
|
||||
}
|
||||
|
||||
&:last-child:not(:first-child) {
|
||||
border-radius: 0px var(--radius-xl) var(--radius-xl) 0px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
bind:this={element}
|
||||
class={[
|
||||
buttonSize[size],
|
||||
'btn btn-secondary select rounded-xl appearance-none pr-6! w-full shadow-xs',
|
||||
'btn btn-secondary select rounded-xl appearance-none pr-6! w-full',
|
||||
selectClass,
|
||||
clazz,
|
||||
]}
|
||||
|
||||
@@ -115,13 +115,18 @@
|
||||
border-top-color: var(--color-zinc-700);
|
||||
|
||||
@variant hover {
|
||||
@variant dark {
|
||||
background-color: var(--color-zinc-925);
|
||||
}
|
||||
background-color: var(--color-zinc-925);
|
||||
}
|
||||
@variant active {
|
||||
background-color: var(--color-zinc-950);
|
||||
}
|
||||
}
|
||||
|
||||
@variant hover {
|
||||
background-color: var(--color-slate-50);
|
||||
}
|
||||
|
||||
@variant active {
|
||||
background-color: var(--color-slate-100);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user