@font-face {
font-family: font-light;
src: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/42764/CircularSpotifyText-Light.otf);
}
@font-face {
font-family: font-bold;
src: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/42764/CircularSpotifyText-Bold.otf);
}
%clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}
$color-green: #b3f5ad;
$color-red: #D0606C;
$color-orange: #EC8550;
$color-black: #212121;
$color-brown-light: #FCF0E0;
* {
box-sizing: border-box;
}
body {
padding: 50px;
background-color: #eee;
}
.recipe-grid {
@extend %clearfix;
$gutter: 30px;
$columns: 4;
margin-left: -($gutter / 2);
margin-right: -($gutter / 2);
& > &__item {
padding-left: ($gutter / 2);
padding-right: ($gutter / 2);
float: left;
width: 100% / $columns;
&:nth-of-type(#{$columns}n + 1) {
clear: none;
}
}
}
.recipe-card {
$box-shadow-color: #ddd;
overflow: hidden;
font-family: font-light;
border-radius: 5px;
background-color: $color-black;
&__cover {
position: relative;
padding-top: 80%;
background-color: #ccc;
text-shadow: 0px 0px 2px rgba($color-black, 1);
background-position: center center;
bakground-repeat: no-repeat;
background-size: cover;
}
&__title {
margin: 0;
font-size: 22px;
color: white;
line-height: 1.2;
padding: 0 20px 10px;
}
&__details {
margin-top: 5px;
padding-top: 8px;
border-top: 1px solid rgba($color-black,1);
color: #ddd;
padding: 8px 10px 8px 20px;
background-color: rgba($color-black,.4);
font-size: 14px;
}
&__image {
display: none;
}
&__overlay {
position: absolute;
top: 0;
bottom: 0;
right: 0;
left: 0;
cursor: pointer;
background: linear-gradient(top, rgba($color-black, 0.2 ) 0%, rgba($color-black, 0.9 ) 100% );
&-info {
position: absolute;
bottom: 0;
z-index: 1;
}
}
&__time,
&__ingredients {
display: inline-block;
line-height: 1;
margin-right: 10px;
}
&__time {
&-icon {
display: inline-block;
margin-right: 3px;
}
}
&__ingredients {
}
&__footer {
@extend %clearfix;
padding: 10px 15px;
}
&__rating,
&__cta {
width: 50%;
padding: 0 5px;
float: left;
}
&__rating {
&-label {
color: #ccc;
font-size: 10px;
text-transform: uppercase;
margin: 4px 0;
}
&-bar {
position: relative;
background: #424242;
height: 6px;
border-radius: 6px;
overflow: hidden;
}
&-value {
background-color: $color-red;
position: absolute;
border-radius: 6px;
top: 0;
bottom: 0;
left: 0;
}
}
&__button {
color: #fff;
background-color: $color-red;
padding: 6px 10px;
border-radius: 3px;
display: block;
text-align: center;
font-size: 16px;
text-transform: uppercase;
cursor: pointer;
text-decoration: none;
}
&__site {
color: #fff;
font-size: 12px;
padding: 0 20px 15px;
line-height: 1;
font-style: italic;
&-link {
color: $color-green;
text-decoration: none;
}
}
}
View Compiled