Lib: Add shadow option to Button component
This commit is contained in:
@ -33,6 +33,9 @@
|
||||
|
||||
/** The PopupSettings to trigger on click. Only if "href" is undefined. */
|
||||
trigger_popup?: PopupSettings;
|
||||
|
||||
/** Should the button have a shadow? */
|
||||
shadow?: boolean;
|
||||
}
|
||||
|
||||
let {
|
||||
@ -44,6 +47,7 @@
|
||||
activate = false,
|
||||
activate_href = false,
|
||||
trigger_popup = { event: "click", target: "invalid" },
|
||||
shadow = false,
|
||||
...restProps
|
||||
}: ButtonProps = $props();
|
||||
</script>
|
||||
@ -57,7 +61,7 @@
|
||||
? `variant-filled-${color}`
|
||||
: ''} {width} {activate ? 'btn-hover' : ''} {activate_href && is_at_path(href)
|
||||
? 'btn-hover'
|
||||
: ''}"
|
||||
: ''} {shadow ? 'shadow' : ''}"
|
||||
draggable="false"
|
||||
{...restProps}>{@render children()}</button
|
||||
>
|
||||
@ -67,7 +71,7 @@
|
||||
type={submit ? "submit" : "button"}
|
||||
class="btn select-none px-2 py-2 {color ? `variant-filled-${color}` : ''} {width} {activate
|
||||
? 'btn-hover'
|
||||
: ''}"
|
||||
: ''} {shadow ? 'shadow' : ''}"
|
||||
draggable="false"
|
||||
use:popup={trigger_popup}
|
||||
{...restProps}>{@render children()}</button
|
||||
|
Reference in New Issue
Block a user