tailwind-border-gradients

1.1.2 • Public • Published

tailwind-border-gradients

Adds the ability to use gradients on borders inside your Tailwind CSS project

Installation

npm install tailwind-border-gradients

Inside your tailwind.config.js file, require the plugin inside the plugins option

module.exports = {
  plugins: [require('tailwind-border-gradients')]
};

Usage

You can apply a border gradient to an element by using the utility class border-gradient-to-{direction}.

<h1 class="border-2 border-gradient-to-br from-red-500 to-blue-500">Border Gradients!</h1>


Custom Colors

This plugin uses Tailwind's gradient color stops, which include all default colors and colors defined in your tailwind.config.js file.

Example:

// tailwind.config.js
module.exports = {
  theme: {
    extend: {
      colors: {
        myColor: '#5cb6f7',
        myOtherColor: '#c4ff8a'
      }
    }
  }
};

In this case, to create a border gradient using your custom colors, you would use:

<h1 class="border-{size} border-gradient-to-{direction} from-myColor to-myOtherColor">Text</h1>

Package Sidebar

Install

npm i tailwind-border-gradients

Weekly Downloads

6

Version

1.1.2

License

GPL-3.0

Unpacked Size

39.1 kB

Total Files

7

Last publish

Collaborators

  • frozn