feat: focus ring class

This commit is contained in:
Zachery Ng 2024-02-19 20:05:29 +08:00
parent 082353e9bc
commit d498ba7e9a
3 changed files with 30 additions and 5 deletions

View File

@ -1,3 +1,9 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer utilities {
.focus-ring {
@apply focus-visible:ring-[3px] focus-visible:ring-snowball-200 focus-visible:ring-offset-1 focus-visible:ring-offset-snowball-500 focus-visible:outline-none;
}
}

View File

@ -18,10 +18,22 @@ const Page = () => {
<h1 className="text-2xl font-bold">Component A</h1>
<div className="flex flex-row gap-10 items-center justify-center">
<div className="h-20 w-40 bg-red-400 rounded-md" />
<div className="h-20 w-40 bg-red-400 rounded-md" />
<div className="h-20 w-40 bg-red-400 rounded-md" />
<div className="h-20 w-40 bg-red-400 rounded-md" />
<div
tabIndex={0}
className="h-20 w-40 bg-red-400 rounded-md focus-ring"
/>
<div
tabIndex={0}
className="h-20 w-40 bg-red-400 rounded-md focus-ring"
/>
<div
tabIndex={0}
className="h-20 w-40 bg-red-400 rounded-md focus-ring"
/>
<div
tabIndex={0}
className="h-20 w-40 bg-red-400 rounded-md focus-ring"
/>
</div>
<div className="flex flex-row gap-10 items-center justify-center">

View File

@ -8,7 +8,14 @@ export default withMT({
'../../node_modules/@material-tailwind/react/theme/components/**/*.{js,ts,jsx,tsx}',
],
theme: {
extend: {},
extend: {
colors: {
snowball: {
200: '#DDEEFD',
500: '#47A4FA',
},
},
},
},
plugins: [],
});