Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hover with icon and text #15

Open
msfarrel opened this issue Jun 26, 2013 · 2 comments
Open

Hover with icon and text #15

msfarrel opened this issue Jun 26, 2013 · 2 comments

Comments

@msfarrel
Copy link

Is there a better solution to handle hover on a link with both an image and text, for example:

<a href=""><i class="ico-map"></i> Map</a>

This solution works but it adds a ton of unnecessary css:

.ico-map {@include retina-sprite(map);}
a:hover .ico-map {@include retina-sprite(map_hover);}

@AdamBrodzinski
Copy link
Owner

Thanks for opening up this issue. Can you paste the css that it outputs?
I'll try to look into this further over the weekend.

@msfarrel
Copy link
Author

It just repeats everything twice, when ideally you just want to change the background position. Either way love this mixin!

.ico-map {
  height: 20px;
  width: 20px;
  background-image: url('/images/icons-sb2c733adb8.png');
  background-position: 0 -412px;
  background-repeat: no-repeat;
  vertical-align: top;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3 / 2), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
  .ico-map {
    background-image: url('/images/icons2x-s8ffb66b8ca.png');
    background-position: 0 -456px;
    -webkit-background-size: 316px auto;
    -moz-background-size: 316px auto;
    -o-background-size: 316px auto;
    background-size: 316px auto;
  }
}

a:hover .ico-map {
  height: 20px;
  width: 20px;
  background-image: url('/images/icons-sb2c733adb8.png');
  background-position: 0 -354px;
  background-repeat: no-repeat;
}
@media (-webkit-min-device-pixel-ratio: 1.5), (min--moz-device-pixel-ratio: 1.5), (-o-min-device-pixel-ratio: 3 / 2), (min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) {
  a:hover .ico-map {
    background-image: url('/images/icons2x-s8ffb66b8ca.png');
    background-position: 0 -476px;
    -webkit-background-size: 316px auto;
    -moz-background-size: 316px auto;
    -o-background-size: 316px auto;
    background-size: 316px auto;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants