![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
tailwindcss-border-gradient-radius
Advanced tools
Tailwind CSS plugin for generating border gradients with could be used with the rounded utility
Tailwind CSS plugin for generating border gradients with could be used with the rounded utility class.
See it in action: https://play.tailwindcss.com/9LSkQgkY7p
This plugin requires Tailwind CSS 3 or later.
npm install tailwindcss-border-gradient-radius
yarn add tailwindcss-border-gradient-radius
{
theme:
extend: {
linearBorderGradients: ({theme }) => ({
colors: {
'light-blue': [colors.indigo[200], colors.lime[300]],
},
background: theme('colors'),
}),
plugins: [
require('tailwindcss-border-gradient-radius'),
],
}
:warning: Using variants extend is at the moment not supported! Please note that at the moment variants could be only added by using variants, where you replace all default generated variants.
{
theme: {
linearBorderGradients: {
directions: { // defaults to these values
't': 'to top',
'tr': 'to top right',
'r': 'to right',
'br': 'to bottom right',
'b': 'to bottom',
'bl': 'to bottom left',
'l': 'to left',
'tl': 'to top left',
},
colors: { // defaults to {}
'red': '#f00',
'red-blue': ['#f00', '#00f'],
'blue-green': ['#0000ff', '#00FF00'],
'red-green-blue': ['#f00', '#0f0', '#00f'],
'black-white-with-stops': ['#000', '#000 45%', '#fff 55%', '#fff'],
},
background: {
'gray-50': '#F9FAFB',
'gray-900':'#111827',
},
borders: { // defaults to these values (optional)
'1': '1px',
'2': '2px',
'4': '4px',
},
},
},
plugins: [
require('tailwindcss-border-gradient-radius'),
],
}
To learn more about the backgrounds of Gradient Borders based on CSS see Method 2: https://dev.to/rumansaleem/gradient-borders-with-css-3mnk
It's recommended to limit the generated utility classes to a miminum to speed up the build process.
This plugin generates the following utilities:
/* configurable with the "linearBorderGradients" theme object */
.border-gradient-[direction-key]-[color-key]-[background-key] {
background:
linear-gradient( to right, [background-value], [background-value] ),
linear-gradient(to [direction-value], [color-value-1], [color-value2], [color-value-n]);
background-clip: padding-box, border-box;
background-origin: padding-box, border-box;
}
/* for easier usage it also generates gradient-border for specifying the border width */
.gradient-border-[border-key] {
border: [border-value] solid transparent;
}
https://play.tailwindcss.com/9LSkQgkY7p
<div class="bg-gray-900 p-12">
<div class="text-center">
<h1 class="text-gray-100 text-medium mb-3">Border gradient rounded and border styled with native tailwind utilities classes </h1>
<button type="button" class="inline-flex items-center px-6 py-3 border-gradient-br-blue-green-gray-900 border-transparent border-solid border-2 rounded-xl text-gray-100 text-lg">Button text</button>
</div>
<div class="text-center m-8 pt-8">
<h1 class="text-gray-100 text-medium mb-3">Border gradient with rounded-full, hover and gradient-border utility</h1>
<button type="button" class="inline-flex items-center px-6 py-3 border-gradient-br-blue-green-gray-900 hover:border-gradient-tl-blue-green-gray-900 gradient-border-2 rounded-full text-gray-100 text-lg">Button text</button>
</div>
</div>
[3.0.0] - 2022-03-08
Updates to Tailwind 3.
FAQs
Tailwind CSS plugin for generating border gradients with could be used with the rounded utility
The npm package tailwindcss-border-gradient-radius receives a total of 0 weekly downloads. As such, tailwindcss-border-gradient-radius popularity was classified as not popular.
We found that tailwindcss-border-gradient-radius demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.