aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/public/css/retina.less
blob: 5de0722005c597ee7fcdc8349cebd582c6eb5de4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
// retina.less
// A helper mixin for applying high-resolution background images (http://www.retinajs.com)

.at2x(@path, @w: auto, @h: auto) {
  background-image: url(@path);
  @at2x_path: ~`"@{path}".split('.').slice(0, "@{path}".split('.').length - 1).join(".") + "@2x" + "." + "@{path}".split('.')["@{path}".split('.').length - 1]`;

  @media all and (-webkit-min-device-pixel-ratio : 1.5) {
    background-image: url(@at2x_path);
    background-size: @w @h;
  }  
}