Skip to content

Instantly share code, notes, and snippets.

@codebender828
Created March 2, 2022 09:13
Show Gist options
  • Save codebender828/d14340302c5d74c046fec60a1db0197e to your computer and use it in GitHub Desktop.
Save codebender828/d14340302c5d74c046fec60a1db0197e to your computer and use it in GitHub Desktop.
Stacked avatars SCSS
<div class="flex flex-col justify-center items-center">
<div class="wrapper flex mb-3">
<a href="#" target="__blank" class="avatar bg-green-100 w-12 h-12 shadow-lg"><img src="https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1100&q=80" alt="avatar1" class="image">
</a>
<a href="#" target="__blank" class="avatar bg-green-100 w-12 h-12 shadow-lg"><img src="https://images.unsplash.com/photo-1544005313-94ddf0286df2?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60" alt="avatar2" class="image">
</a>
<a href="#" target="__blank" class="avatar bg-green-100 w-12 h-12 shadow-lg"><img src="https://images.unsplash.com/photo-1527980965255-d3b416303d12?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1100&q=80" alt="avatar3" class="image">
</a>
<a href="#" target="__blank" class="avatar bg-green-100 w-12 h-12 shadow-lg"><img src="https://images.unsplash.com/photo-1540746354979-c2ecadbc01d6?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=60" alt="avatar4" class="image">
</a>
<a href="#" target="__blank" class="avatar bg-green-100 w-12 h-12 shadow-lg"><img src="https://images.unsplash.com/photo-1547147607-6eab7b49f3ee?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=60" alt="avatar5" class="image">
</a>
</div>
<p class="text-xl font-regular">
Live users
</p>
</div>
@import url('https://fonts.googleapis.com/css?family=Rubik:300,400,700&display=swap');
body {
display: flex;
justify-content: center;
align-items: center;
background: #dfdfef;
height: 100%;
font-family: 'Rubik', sans-serif;
}
html {
width: 100%;
height: 100%;
}
.avatar {
overflow: hidden;
border-radius: 99%;
border: 3px #fff solid;
margin-left: -10px;
opacity: 0.6;
transition: all 0.1s ease-in;
flex-shrink: 0;
&:hover {
opacity: 1;
cursor: pointer;
transform: translateY(-5px);
z-index: 2;
}
.image {
width: 100%;
overflow: hidden;
object-fit: cover;
}
}
.wrapper {
position: relative;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/1.0.6/tailwind.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment