Skip to content

Instantly share code, notes, and snippets.

@jitendravyas
Created February 15, 2013 12:14
Show Gist options
  • Save jitendravyas/4960057 to your computer and use it in GitHub Desktop.
Save jitendravyas/4960057 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com, the Sass playground.
// Sass v3.2.7
//How can I get hover position without calculating it manually?
//My aim was to create a mixin to save time by not repeating the code for hover
//and value of hover
@mixin spriting-position($offset-x, $offset-y) {
background-position:$offset-x $offset-y;
&:hover{
$hover-offset-x: $offset-x + 75;
background-position: $hover-offset-x $offset-y;
}
}
.hotel-filter-sprite-All {
@include spriting-position(100px, 14px);
}
// .hotel-filter-sprite-luxury{
// @include spriting-position(200, 14px);
//}
// .hotel-filter-sprite-Boutique-hotel{
// @include spriting-position(300px, 14px);
// }
// .hotel-filter-sprite-Camp{
// @include spriting-position(400px, 14px);
// }
.hotel-filter-sprite-All {
background-position: 100px 14px;
}
.hotel-filter-sprite-All:hover {
background-position: 175px 14px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment