Skip to content
This repository has been archived by the owner on Mar 2, 2018. It is now read-only.

Commit

Permalink
Cards: Images go semitransparent on hover, to let background color sh…
Browse files Browse the repository at this point in the history
…ine through
  • Loading branch information
doppelganger113 authored and Magnus Gyllenswärd committed Jun 5, 2015
1 parent 3fc72c2 commit 74f8a20
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions source/stylesheets/refills/_cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@
$card-border: 1px solid $card-border-color;
$card-background: lighten($card-border-color, 10%);
$card-header-background: $card-background;
$card-hover-background: lighten($card-background, 5%);
$card-image-background: #DBD199;
$card-image-hover-background: lighten($card-image-background, 5%);
$card-margin: 1em;
$card-image-hover-opacity: 0.7;
$card-image-hover-color: #F8F2B4;

@include flex-basis(15em);
@include flex-grow(1);
Expand All @@ -33,16 +32,19 @@
margin: 0 $card-margin $base-spacing $card-margin;
position: relative;


.card-image {
overflow: hidden;
height: 150px;
max-height: 150px;
background-color: $card-image-hover-color;

img {
@include transition (all 0.2s ease-in-out);
background: $card-image-background;
border-top-left-radius: $base-border-radius;
border-top-right-radius: $base-border-radius;
width: 100%;
opacity: 1;
}
}

Expand All @@ -65,17 +67,13 @@
margin: 0 0 ($base-spacing / 2);
}
}

&:focus,
&:hover {
background-color: $card-hover-background;

.card-image img {
background: $card-image-hover-background;
}

.card-header {
background-color: $card-hover-background;
cursor: pointer;

img {
opacity: $card-image-hover-opacity;
}
}

Expand Down

0 comments on commit 74f8a20

Please sign in to comment.