Skip to content

Commit

Permalink
fix(button): Button ring on focus (#1238)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nigellima authored Jan 22, 2024
1 parent 4a26a50 commit 406ebe5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Button/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import type { FlowbiteButtonTheme } from './Button';
import type { FlowbiteButtonGroupTheme } from './ButtonGroup';

export const buttonTheme: FlowbiteButtonTheme = {
base: 'group flex items-stretch items-center justify-center p-0.5 text-center font-medium relative focus:z-10 focus:outline-none',
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]',
fullSized: 'w-full',
color: {
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',
failure:
'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',
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',
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',
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',
light:
'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',
Expand Down Expand Up @@ -119,9 +119,9 @@ export const buttonTheme: FlowbiteButtonTheme = {
export const buttonGroupTheme: FlowbiteButtonGroupTheme = {
base: 'inline-flex',
position: {
none: 'focus:ring-2',
start: 'rounded-r-none',
middle: 'rounded-none border-l-0 pl-0',
end: 'rounded-l-none border-l-0 pl-0',
none: '',
start: 'rounded-r-none focus:ring-2',
middle: 'rounded-none border-l-0 pl-0 focus:ring-2',
end: 'rounded-l-none border-l-0 pl-0 focus:ring-2',
},
};

1 comment on commit 406ebe5

@vercel
Copy link

@vercel vercel bot commented on 406ebe5 Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.