I'm trying to use the background-position/transition hack found here and here to animate the background transition of a panel on hover... I'm not sure what I'm doing wrong but it isn't working for me.
Here's the relevant code I have so far (using Bootstrap v3)
html:
<div class="panel panel-default">
<div class="panel-body">
<span class="glyphicon glyphicon-link" aria-hidden="true"></span>
<strong>Portfolio Name: </strong>Foo
</div>
</div>
scss:
.panel,
.panel-default {
border-radius: 3rem;
cursor: pointer;
cursor: hand;
overflow: hidden;
}
.panel-body {
background-image: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#f4f4f4));
background-image: -webkit-linear-gradient(#fff, #f4f4f4);
background-image: -moz-linear-gradient(#fff, #f4f4f4);
background-image: -o-linear-gradient(#fff, #f4f4f4);
background-image: linear-gradient(#fff, #f4f4f4);
-webkit-background-size: auto 200%;
background-size: auto 200%;
background-position: 0 100%;
font-size: medium;
padding-left: 56px;
padding-left: 3.5rem;
-webkit-transition: all 1s linear;
-moz-transition: all 1s linear;
-o-transition: all 1s linear;
transition: all 1s linear;
.glyphicon-link {
padding-right: 56px;
padding-right: 3.5rem;
}
}
.panel-body:hover {
background-image: -webkit-gradient(linear, left top, left bottom, from(#337ab7), to(#093479));
background-image: -webkit-linear-gradient(#337ab7, #093479);
background-image: -moz-linear-gradient(#337ab7, #093479);
background-image: -o-linear-gradient(#337ab7, #093479);
background-image: linear-gradient(#337ab7, #093479);
background-position: 0 0;
color: white;
padding-left: 88px;
padding-left: 5.5rem;
}
.panel-body:active {
background-image: -webkit-gradient(linear, left top, left bottom, from(#1eb759), to(#4f8547));
background-image: -webkit-linear-gradient(#1eb759, #4f8547);
background-image: -moz-linear-gradient(#1eb759, #4f8547);
background-image: -o-linear-gradient(#1eb759, #4f8547);
background-image: linear-gradient(#1eb759, #4f8547);
}
I also set up a jsfiddle here: