Skip to content

Commit 841c668

Browse files
Enhance Button component styles with improved hover effects and shadows for better visual feedback and user interaction
1 parent a814acd commit 841c668

1 file changed

Lines changed: 10 additions & 11 deletions

File tree

resources/js/Components/Button.vue

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,45 +95,44 @@ const buttonSizeClasses = computed(() => {
9595
});
9696
9797
const buttonClasses = computed(() => {
98-
const baseClasses = 'inline-flex items-center justify-center font-medium tracking-wide transition-all duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed';
98+
const baseClasses = 'inline-flex items-center justify-center font-medium tracking-wide transition-all duration-300 ease-out transform hover:scale-[1.02] focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed disabled:hover:scale-100';
9999
const roundedClass = props.rounded ? 'rounded-full' : 'rounded-md';
100100
const widthClass = props.fullWidth ? 'w-full' : '';
101101
102102
let variantClasses;
103103
switch (props.variant) {
104104
case 'danger':
105-
variantClasses = 'border border-transparent bg-red-600 text-white hover:bg-red-700 focus:ring-red-500 active:bg-red-800 dark:focus:ring-offset-gray-800';
105+
variantClasses = 'border border-transparent bg-red-600 text-white hover:bg-red-700 hover:shadow-md hover:shadow-red-500/20 focus:ring-red-500 active:bg-red-800 dark:focus:ring-offset-gray-800';
106106
break;
107107
case 'success':
108-
variantClasses = 'border border-transparent bg-green-600 text-white hover:bg-green-700 focus:ring-green-500 active:bg-green-800 dark:focus:ring-offset-gray-800';
108+
variantClasses = 'border border-transparent bg-green-600 text-white hover:bg-green-700 hover:shadow-md hover:shadow-green-500/20 focus:ring-green-500 active:bg-green-800 dark:focus:ring-offset-gray-800';
109109
break;
110110
case 'warning':
111-
variantClasses = 'border border-transparent bg-yellow-500 text-white hover:bg-yellow-600 focus:ring-yellow-500 active:bg-yellow-700 dark:focus:ring-offset-gray-800';
111+
variantClasses = 'border border-transparent bg-yellow-500 text-white hover:bg-yellow-600 hover:shadow-md hover:shadow-yellow-500/20 focus:ring-yellow-500 active:bg-yellow-700 dark:focus:ring-offset-gray-800';
112112
break;
113113
case 'info':
114-
variantClasses = 'border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500 active:bg-blue-800 dark:focus:ring-offset-gray-800';
114+
variantClasses = 'border border-transparent bg-blue-600 text-white hover:bg-blue-700 hover:shadow-md hover:shadow-blue-500/20 focus:ring-blue-500 active:bg-blue-800 dark:focus:ring-offset-gray-800';
115115
break;
116116
case 'outline':
117-
variantClasses = 'border border-gray-300 bg-transparent text-gray-800 hover:bg-gray-50 focus:ring-gray-400 active:bg-gray-100 dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-800 dark:focus:ring-offset-gray-800 dark:active:bg-gray-700';
117+
variantClasses = 'border border-gray-300 bg-transparent text-gray-800 hover:bg-gray-50 hover:border-gray-400 hover:shadow-sm focus:ring-gray-400 active:bg-gray-100 dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-800 dark:focus:ring-offset-gray-800 dark:active:bg-gray-700';
118118
break;
119119
case 'secondary':
120-
variantClasses = 'border border-transparent bg-gray-600 text-white hover:bg-gray-700 focus:ring-gray-500 active:bg-gray-800 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-offset-gray-800';
120+
variantClasses = 'border border-transparent bg-gray-600 text-white hover:bg-gray-700 hover:shadow-md hover:shadow-gray-500/20 focus:ring-gray-500 active:bg-gray-800 dark:bg-gray-700 dark:hover:bg-gray-600 dark:focus:ring-offset-gray-800';
121121
break;
122122
case 'ghost':
123-
variantClasses = 'border border-transparent bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-400 active:bg-gray-200 dark:text-gray-300 dark:hover:bg-gray-800 dark:focus:ring-offset-gray-800';
123+
variantClasses = 'border border-transparent bg-transparent text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:ring-gray-400 active:bg-gray-200 dark:text-gray-300 dark:hover:bg-gray-800 dark:hover:text-gray-100 dark:focus:ring-offset-gray-800';
124124
break;
125125
case 'link':
126-
variantClasses = 'border-0 bg-transparent text-blue-600 hover:text-blue-800 underline focus:ring-blue-500 dark:text-blue-400 dark:hover:text-blue-300';
126+
variantClasses = 'border-0 bg-transparent text-blue-600 hover:text-blue-800 hover:underline-offset-4 underline focus:ring-blue-500 dark:text-blue-400 dark:hover:text-blue-300';
127127
break;
128128
case 'primary':
129129
default:
130-
variantClasses = 'border border-transparent bg-gray-800 text-white hover:bg-gray-700 focus:ring-gray-600 active:bg-gray-900 dark:bg-gray-200 dark:text-gray-800 dark:hover:bg-white dark:focus:ring-offset-gray-800';
130+
variantClasses = 'border border-transparent bg-gray-800 text-white hover:bg-gray-700 hover:shadow-md hover:shadow-gray-800/20 focus:ring-gray-600 active:bg-gray-900 dark:bg-gray-200 dark:text-gray-800 dark:hover:bg-white dark:focus:ring-offset-gray-800';
131131
break;
132132
}
133133
134134
return [baseClasses, variantClasses, buttonSizeClasses.value, roundedClass, widthClass];
135135
});
136-
137136
const isActuallyDisabled = computed(() => props.disabled || props.isLoading);
138137
139138
const Tag = computed(() => {

0 commit comments

Comments
 (0)