Skip to content

Commit 9acbd9e

Browse files
committed
fix: fixed button looking vertically off center next to other elements
- The sm shadow is too far down, added custom subtle shadow. - Also added slight highlight to make buttons pop better in dark mode.
1 parent d537db7 commit 9acbd9e

File tree

2 files changed

+46
-4
lines changed

2 files changed

+46
-4
lines changed

src/components/LibButton/LibButton.vue

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,30 @@
2525
border && `
2626
transition-all
2727
bg-neutral-100
28-
shadow-sm
29-
shadow-neutral-950/50
30-
hover:shadow-md
28+
shadow-[0_1px_1px_0]
29+
shadow-neutral-950/20
30+
hover:shadow-[0_1px_3px_0]
3131
hover:shadow-neutral-950/30
3232
hover:border-neutral-300
3333
34+
relative
35+
after:absolute
36+
after:rounded
37+
after:inset-0
38+
after:content
39+
after:shadow-[0_1px_0_0_inset]
40+
after:shadow-bg/20
41+
hover:after:shadow-bg/60
42+
dark:after:shadow-bg/10
43+
dark:hover:after:shadow-bg/50
44+
after:pointer-events-none
45+
after:mix-blend-overlay
46+
3447
active:shadow-inner
3548
active:shadow-fg/20
3649
active:border-transparent
3750
border
38-
border-neutral-200
51+
border-neutral-400
3952
disabled:border-neutral-200
4053
disabled:bg-neutral-50
4154
@@ -47,6 +60,12 @@
4760
dark:disabled:border-neutral-800
4861
dark:disabled:bg-neutral-900
4962
`,
63+
border && ( !color || color === `secondary` ) && `
64+
after:shadow-bg/90
65+
hover:after:shadow-bg
66+
dark:after:shadow-bg/20
67+
dark:hover:after:shadow-bg/90
68+
`,
5069
!border && color === `primary` && `
5170
font-bold
5271
hover:text-accent-50

src/components/LibInput/LibInput.stories.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,26 @@ export const InputSlotReplacement: Story = {
263263
},
264264
}
265265

266+
267+
export const NextToButton: Story = {
268+
render: args => ({
269+
components: { ...components, LibInput },
270+
setup: () => ({
271+
args,
272+
}),
273+
274+
template: `
275+
<div class="flex gap-2 items-center">
276+
<lib-input
277+
v-bind="args"
278+
v-model:values="args.values"
279+
v-model="args.modelValue"
280+
:label="undefined"
281+
>
282+
</lib-input>
283+
<lib-button>Button</lib-button>
284+
</div>
285+
`,
286+
}),
287+
}
288+

0 commit comments

Comments
 (0)