TailwindCSS variant to style autocompleted form fields.
yarn add tailwindcss-autofill
Or if you use npm
:
npm i --save tailwindcss-autofill
Add to plugins
in your tailwind.config.js:
module.exports = {
// ...
plugins: [
require("tailwindcss-autofill"),
// Other plugins.
],
variants: {
extend: {
borderColor: ["autofill", "dark"], // Enable `autofill` variant for plugins you want.
},
},
};
Style your components using autofill:
:
<input className="border border-gray-100 autofill:border-gray-900" />
-
Node.js 12+
-
TailwindCSS 2
Made by @phuctm97.