Hover effect on icons
See original GitHub issueIs it possible to build sprite with :hover
pseudo-class in css?
For example:
The icon folder contains icons for normal state and hover state:
icns
├── print.png
└── print_hover.png
gulp task
var pngSprite = require('gulp.spritesmith');
gulp.task('sprite-png', function () {
return gulp.src('./icons')
.pipe(pngSprite({
imgName: 'sprite.png',
cssName: 'sprite.css',
// this is what I want
hoverImageName: function (name) {
return name + '_hover';
}
}))
.pipe(gulp.dest('./sprite'));
});
I am expecting to see something like this in css file
.icons-print {
background-image: url(./sprites/sprite.png);
background-position: -734px -618px;
width: 16px;
height: 16px;
}
.icns-print:hover {
background-image: url(./sprites/sprite.png);
background-position: -683px -618px;
width: 16px;
height: 16px;
}
Issue Analytics
- State:
- Created 9 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
How to create icon hover effect using CSS ? - GeeksforGeeks
How to create icon hover effect using CSS ? · 1: All the anchor tags are targeted with the CSS declarations (within the...
Read more >Simple Icon Hover Effects with CSS Transitions and Animations
Icon Hover Effects Simple hover effects for circular icons.
Read more >4 Awesome icons hover effect using only HTML & CSS
4 Awesome icons hover effect using only HTML & CSS ; ◘ Like our page : https://www.facebook.com/darkcode0/ ; ◘ Paypal donation link :...
Read more >Hover.css - A collection of CSS3 powered hover effects
All Hover.css effects make use of a single element (with the help of some pseudo-elements where necessary), are self contained so you can...
Read more >Glowing Icon Hover Effect - CodePen
Adding Classes. In CodePen, whatever you write in the HTML editor is what goes within the <body> tags in a basic HTML5 template....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunatly propery: cssClass, is deprecated in 3.0.0 version of grunt-spritesmith, now use property: cssSelector instead. My code finally has worked after some edit:
For non-CSS templates, you can leverage the provided
sprite
mixin. Here is an example for SCSS: