Tailwindcss plugin to color caret in input fields

  • By Krishan KΓΆnig
  • Last update: Apr 6, 2021
  • Comments: 1

Caret Color - TailwindCSS Plugin

npm npm

This plugin generates classes for coloring carets using caret-color: #;.

Installation

Pull it in through npm or yarn:

npm install tailwind-caret-color
yarn add tailwind-caret-color

Usage

Add it to the plugins array of your Tailwind config.

plugins: [
  // Other plugins
  require('tailwind-caret-color')(),
],

For each color in colors config of tailwind a caret-{color} class is created, analog to bg- and text- classes.

License

This project is licensed under the MIT License.

Github

https://github.com/naoray/tailwind-caret-color

Comments(1)

  • 1

    Plugin seems not to create variants with tailwind 2

    Hey! ;)

    I installed your plugin:

    plugins: [
         require('@tailwindcss/ui'),
         require('tailwind-caret-color')(),
     ],
    

    Then run yarn watch

    And it just created the classes:

    .caret-transparent {
      caret-color: transparent;
    }
    
    .caret-white {
      caret-color: #ffffff;
    }
    
    .caret-black {
      caret-color: #000000;
    }
    

    I need it for darkmode. So a dark:caret-gray-100 would be perfect.

    Do you think this is possible?