Skip to content

Commit ccebf91

Browse files
committed
fix: improve design of buttons/links with icons (#1255)
1 parent 7d69561 commit ccebf91

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

app/components/Button/Base.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ defineExpose({
3232
:class="{
3333
'inline-flex': !block,
3434
'flex': block,
35-
'text-sm px-4 py-2': size === 'medium',
36-
'text-xs px-2 py-0.5': size === 'small',
35+
'text-sm py-2': size === 'medium',
36+
'px-4': size === 'medium' && !classicon,
37+
'ps-3 pe-4': size === 'medium' && !!classicon,
38+
'text-xs py-0.5': size === 'small',
39+
'px-2': size === 'small' && !classicon,
40+
'ps-1.5 pe-2': size === 'small' && !!classicon,
3741
'bg-transparent text-fg hover:enabled:(bg-fg/10) focus-visible:enabled:(bg-fg/10) aria-pressed:(bg-fg/10 border-fg/20 hover:enabled:(bg-fg/20 text-fg/50))':
3842
variant === 'secondary',
3943
'text-bg bg-fg hover:enabled:(bg-fg/50) focus-visible:enabled:(bg-fg/50) aria-pressed:(bg-fg text-bg border-fg hover:enabled:(text-bg/50))':

app/components/Link/Base.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ const isButtonMedium = computed(() => props.size === 'medium' && !isLink.value)
6565
'inline-flex': !block,
6666
'opacity-50 gap-x-1 items-center justify-center font-mono border border-transparent rounded-md':
6767
isButton,
68-
'text-sm px-4 py-2': isButtonMedium,
69-
'text-xs px-2 py-0.5': isButtonSmall,
68+
'text-sm py-2': isButtonMedium,
69+
'px-4': isButtonMedium && !classicon,
70+
'ps-3 pe-4': isButtonMedium && !!classicon,
71+
'text-xs py-0.5': isButtonSmall,
72+
'px-2': isButtonSmall && !classicon,
73+
'ps-1.5 pe-2': isButtonSmall && !!classicon,
7074
'text-bg bg-fg': variant === 'button-primary',
7175
'bg-transparent text-fg': variant === 'button-secondary',
7276
}"
@@ -85,8 +89,12 @@ const isButtonMedium = computed(() => props.size === 'medium' && !isLink.value)
8589
isLink,
8690
'justify-center font-mono border border-border rounded-md transition-all duration-200':
8791
isButton,
88-
'text-sm px-4 py-2': isButtonMedium,
89-
'text-xs px-2 py-0.5': isButtonSmall,
92+
'text-sm py-2': isButtonMedium,
93+
'px-4': isButtonMedium && !classicon,
94+
'ps-3 pe-4': isButtonMedium && !!classicon,
95+
'text-xs py-0.5': isButtonSmall,
96+
'px-2': isButtonSmall && !classicon,
97+
'ps-1.5 pe-2': isButtonSmall && !!classicon,
9098
'bg-transparent text-fg hover:(bg-fg/10 text-accent) focus-visible:(bg-fg/10 text-accent) aria-[current=true]:(bg-fg/10 text-accent border-fg/20 hover:enabled:(bg-fg/20 text-fg/50))':
9199
variant === 'button-secondary',
92100
'text-bg bg-fg hover:(bg-fg/50 text-accent) focus-visible:(bg-fg/50) aria-current:(bg-fg text-bg border-fg hover:enabled:(text-bg/50))':

0 commit comments

Comments
 (0)