Last active
April 6, 2023 08:04
-
-
Save niranyousuf/0a3a78bed876753972c10366b8ece8d1 to your computer and use it in GitHub Desktop.
Border gradient color with transparent background and border-radius
This file contains 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
.class_name { | |
border: 0.094rem solid transparent; | |
border-radius: 20px; | |
position: relative; | |
padding-top: 30px; | |
padding-bottom: 20px; | |
&::before { | |
position: absolute; | |
content: ""; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
background: linear-gradient(180deg, #8486a7, transparent) border-box; | |
border: inherit; | |
border-radius: inherit; | |
mask: linear-gradient(#fff, #fff) padding-box, linear-gradient(#fff, #fff); | |
mask-composite: exclude; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment