Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save newmedia2/cc653b2b8cd908f52d30f5dade8a634c to your computer and use it in GitHub Desktop.
Save newmedia2/cc653b2b8cd908f52d30f5dade8a634c to your computer and use it in GitHub Desktop.
Fading content inside border II
<ul>
<li>Cookie chocolate bar </li>
<li>Jelly-o macaroon jelly</li>
<li>Toffee chocolate topping</li>
<li>Chocolate cheesecake maca</li>
<li>Apple pie sesame snaps</li>
<li>Chocolate bar macaroon</li>
<li>Cake cake jelly beans</li>
<li>Snaps bonbon pie gummies</li>
</ul>
ul {
border: 4px solid orange;
/*border-radius: 20px; it works with radius as well */
-webkit-mask:
linear-gradient(#000 0 0),
/* fade only the padding area
(in the opposite direction) */
linear-gradient(#0000,#000 90%) padding-box;
-webkit-mask-composite: xor;
mask-composite: exclude;
}
body {
margin: 0;
min-height: 100vh;
display: grid;
place-content: center;
background: linear-gradient(45deg,#0b4c80,#82167a);
}
ul {
font-size: 2rem;
font-weight: bold;
font-family: sans-serif;
color: #fff;
padding: 2rem 1rem;
list-style-position: inside;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment