Skip to content

Instantly share code, notes, and snippets.

@bdalziel
Created November 6, 2012 00:18
Show Gist options
  • Save bdalziel/4021436 to your computer and use it in GitHub Desktop.
Save bdalziel/4021436 to your computer and use it in GitHub Desktop.
Extended mixin to scale zoomed image
@boundaryScale: 2;
.zoomStep(@zoomFactor) {
@boundarySize: (@boundaryScale * @zoomFactor);
.zoomBoundary {
width: @boundarySize;
height: @boundarySize;
top: (0 - (@boundarySize - 100%)/2);
left: (0 - (@boundarySize - 100%)/2);
}
@imgPrimaryDimensionSize: ((100% + ((@boundarySize - 100%)/2)) / (@boundarySize/100));
.zoomBoundary {
.zoomImg {
width: @imgPrimaryDimensionSize - 1%;
height: @imgPrimaryDimensionSize - 1%;
left: ((100% - (@imgPrimaryDimensionSize - 1%)) /2);
top: ((100% - (@imgPrimaryDimensionSize - 1%)));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment