<div class="color-palette">
<div class="color-1">
<div></div>
<div></div>
<div></div>
<div></div>
<div>slategray</div>
<div>#708090</div>
<div>rgb(112,128,144)</div>
</div>
<div class="color-2">
<div></div>
<div></div>
<div></div>
<div></div>
<div>tomato</div>
<div>#FC644D</div>
<div>rgb(252,100,77)</div>
</div>
<div class="color-3">
<div></div>
<div></div>
<div></div>
<div></div>
<div>whitesmoke</div>
<div>#F5F5F5</div>
<div>rgb(245,245,245)</div>
</div>
</div>
// Colors
$color-1: slategray;
$color-2: tomato;
$color-3: whitesmoke;
body {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
min-height: 100vh;
font-family: 'Source Code Pro', monospace;
background-image: url('https://www.toptal.com/designers/subtlepatterns/patterns/paper.png');
// background-position: center center;
// background-repeat: no-repeat;
// background-size: cover;
}
.color-palette {
position: relative;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 31.25rem;
.color-1, .color-2, .color-3 {
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-end;
width: 9.375rem;
height: 15.625rem;
padding-bottom: 1.25rem;
border-radius: 0.3125rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
&:hover {
box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
}
> div {
position: relative;
display: block;
width: 100%;
padding: 5px 0 0;
color: white;
font-size: 0.75rem;
text-align: center;
}
}
.color-1 {
background-color: $color-1;
> div {
&:nth-of-type(1) {
padding: 10px 0;
background-color: darken($color-1,25%);
}
&:nth-of-type(2) {
padding: 10px 0;
background-color: darken($color-1,15%);
}
&:nth-of-type(3) {
padding: 10px 0;
background-color: lighten($color-1,15%);
}
&:nth-of-type(4) {
margin: 0 0 20px;
padding: 10px 0;
background-color: lighten($color-1,25%);
}
}
}
.color-2 {
background-color: $color-2;
> div {
&:nth-of-type(1) {
padding: 10px 0;
background-color: darken($color-2,25%);
}
&:nth-of-type(2) {
padding: 10px 0;
background-color: darken($color-2,15%);
}
&:nth-of-type(3) {
padding: 10px 0;
background-color: lighten($color-2,15%);
}
&:nth-of-type(4) {
margin: 0 0 20px;
padding: 10px 0;
background-color: lighten($color-2,25%);
}
}
}
.color-3 {
background-color: $color-3;
> div {
color: $color-1;
&:nth-of-type(1) {
padding: 10px 0;
background-color: darken($color-3,25%);
}
&:nth-of-type(2) {
padding: 10px 0;
background-color: darken($color-3,15%);
}
&:nth-of-type(3) {
padding: 10px 0;
background-color: lighten($color-3,1%);
}
&:nth-of-type(4) {
margin: 0 0 20px;
padding: 10px 0;
background-color: lighten($color-3,5%);
}
}
}
}
View Compiled
This Pen doesn't use any external JavaScript resources.