Created
September 16, 2024 15:59
-
-
Save rhcarlosweb/db8438ab944e6f262a9c457c180fe19c to your computer and use it in GitHub Desktop.
Gradient Border Tailwindcss
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@layer components { | |
.gradient-border { | |
@apply relative; | |
&::after { | |
@apply absolute inset-[-1px] pointer-events-none p-[1px] z-[1] bg-gradient-to-r from-transparent to-transparent; | |
content : ''; | |
z-index : 1; | |
mask : linear-gradient(#fff 0 0) content-box, | |
linear-gradient(#fff 0 0) border-box; | |
-webkit-mask : linear-gradient(#fff 0 0) content-box, | |
linear-gradient(#fff 0 0) border-box; | |
-webkit-mask-composite : xor; | |
mask-composite : exclude; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment