antimoderate icon indicating copy to clipboard operation
antimoderate copied to clipboard

Support background-image

Open whackashoe opened this issue 9 years ago • 7 comments

whackashoe avatar Nov 07 '15 04:11 whackashoe

+1

bka-frontend avatar Dec 06 '15 19:12 bka-frontend

+1

kozleek avatar Dec 11 '15 21:12 kozleek

That's exactly what I'm looking for too, but how - this works by crawling the DOM and replacing the contents of an tag + the animation, right?

Can js crawl a separate CSS document and do the same?

huwd avatar Dec 12 '15 16:12 huwd

@huwd yeah right now it replaces the src attribute, a similar thing would need to be done but for background image. the code would just set el.style.backgroundImage to what it would have set to src.

whackashoe avatar Dec 12 '15 22:12 whackashoe

:) Thought I'd try and do a pull request but after some fiddling on codepen I realise I'm outta my depth.js

Is there any chance the solution you describe above could also work at passing in alternative sass variables? Using bourbon neat currently got my $tiny-res and $full-res setup, just need the javascript to swap em and trigger your animation

huwd avatar Dec 13 '15 15:12 huwd

Ahah well thanks for trying :water_buffalo:

It definitely should if the js was implemented for bg image. I guess instead of using a data attribute then, it !might! make sense to pop the tiny-res into their own css classes and have the js read the tiny-res from them. That would also have the added benefit that you could cache that file for the images which would be pretty neat.

whackashoe avatar Dec 14 '15 07:12 whackashoe

+1

DannyFeliz avatar Mar 30 '16 08:03 DannyFeliz