Skip to content

Commit 406ebe5

Browse files
authored
fix(button): Button ring on focus (#1238)
fix(button): fix button ring on focus fixes the button inconsistent focus ring compared to the core library. It also adds a transition of colors and ring
1 parent 4a26a50 commit 406ebe5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/components/Button/theme.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import type { FlowbiteButtonTheme } from './Button';
22
import type { FlowbiteButtonGroupTheme } from './ButtonGroup';
33

44
export const buttonTheme: FlowbiteButtonTheme = {
5-
base: 'group flex items-stretch items-center justify-center p-0.5 text-center font-medium relative focus:z-10 focus:outline-none',
5+
base: 'group flex items-stretch items-center justify-center p-0.5 text-center font-medium relative focus:z-10 focus:outline-none transition-[color,background-color,border-color,text-decoration-color,fill,stroke,box-shadow]',
66
fullSized: 'w-full',
77
color: {
88
dark: 'text-white bg-gray-800 border border-transparent enabled:hover:bg-gray-900 focus:ring-4 focus:ring-gray-300 dark:bg-gray-800 dark:enabled:hover:bg-gray-700 dark:focus:ring-gray-800 dark:border-gray-700',
99
failure:
1010
'text-white bg-red-700 border border-transparent enabled:hover:bg-red-800 focus:ring-4 focus:ring-red-300 dark:bg-red-600 dark:enabled:hover:bg-red-700 dark:focus:ring-red-900',
11-
gray: 'text-gray-900 bg-white border border-gray-200 enabled:hover:bg-gray-100 enabled:hover:text-cyan-700 :ring-cyan-700 focus:text-cyan-700 dark:bg-transparent dark:text-gray-400 dark:border-gray-600 dark:enabled:hover:text-white dark:enabled:hover:bg-gray-700 focus:ring-2',
11+
gray: 'text-gray-900 bg-white border border-gray-200 enabled:hover:bg-gray-100 enabled:hover:text-cyan-700 :ring-cyan-700 focus:text-cyan-700 dark:bg-transparent dark:text-gray-400 dark:border-gray-600 dark:enabled:hover:text-white dark:enabled:hover:bg-gray-700 focus:ring-4',
1212
info: 'text-white bg-cyan-700 border border-transparent enabled:hover:bg-cyan-800 focus:ring-4 focus:ring-cyan-300 dark:bg-cyan-600 dark:enabled:hover:bg-cyan-700 dark:focus:ring-cyan-800',
1313
light:
1414
'text-gray-900 bg-white border border-gray-300 enabled:hover:bg-gray-100 focus:ring-4 focus:ring-cyan-300 dark:bg-gray-600 dark:text-white dark:border-gray-600 dark:enabled:hover:bg-gray-700 dark:enabled:hover:border-gray-700 dark:focus:ring-gray-700',
@@ -119,9 +119,9 @@ export const buttonTheme: FlowbiteButtonTheme = {
119119
export const buttonGroupTheme: FlowbiteButtonGroupTheme = {
120120
base: 'inline-flex',
121121
position: {
122-
none: 'focus:ring-2',
123-
start: 'rounded-r-none',
124-
middle: 'rounded-none border-l-0 pl-0',
125-
end: 'rounded-l-none border-l-0 pl-0',
122+
none: '',
123+
start: 'rounded-r-none focus:ring-2',
124+
middle: 'rounded-none border-l-0 pl-0 focus:ring-2',
125+
end: 'rounded-l-none border-l-0 pl-0 focus:ring-2',
126126
},
127127
};

0 commit comments

Comments
 (0)