tailwindcss-text-fill

🎨 TailwindCSS utilities to override foreground fill color of text content.

Usage no npm install needed!

<script type="module">
  import tailwindcssTextFill from 'https://cdn.skypack.dev/tailwindcss-text-fill';
</script>

README

🎨 tailwindcss-text-fill

npm version GitHub license

Add TailwindCSS utilities to override foreground fill color of text content, is especially useful to style autocompleted form fields with tailwindcss-autofill because color won't work.

Install

yarn add tailwindcss-text-fill

Or if you use npm:

npm i --save tailwindcss-text-fill

Usage

Add to plugins in your tailwind.config.js:

module.exports = {
  // ...
  plugins: [
    require("tailwindcss-text-fill"),
    // Other plugins.
  ],
  variants: {
    extend: {
      textFill: ["dark"], // Enable variants.
    },
  },
};

Style your components text-fill-{color}, e.g. text-fill-gray-100, text-fill-gray-200, text-fill-red-500, etc.

<input className="text-fill-gray-900 dark:text-fill-gray-100" />

Requirements

  • Node.js 12+

  • TailwindCSS 2


Made by @phuctm97.