JSFiddle - React, Tailwind, and code Playground
by Rising_Tide
HTML
<div class="card_container">
<div class="card">
<div class="content">
<div class="title">Title</div>
<div class="subtitle">Subitle</div>
<div class="text">Random random random text</div>
</div>
</div>
</div>
SCSS
$background_color: #2a363b;
$primary_color: #e84a5f;
$secondary_color: #ff847c;
$outline_color: #fecea8;
$color1: lighten($primary_color, 15%);
$color2: $primary_color;
$color3: darken($primary_color, 15%);
.card_container {
width: 33.333%;
padding: 1rem;
}
.card {
display: block;
height: 100%;
text-align: center;
background-color: $color1;
position: relative;
will-change: transform;
&::before {
content: "";
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: -1;
background-color: $color2;
}
&::after {
content: "";
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: -2;
background-color: $color3;
}
&:hover {
transform: translate(-5px, 0);
&::before {
transform: translate(5px, 0);
}
&::after {
transform: translate(10px, 0);
}
}
}
.content {
padding: 4rem 1rem;
}
.title {
font-size: 1.25rem;
background-color: gray;
border-radius: 3px;
padding: 0.5rem;
}