aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2013-03-16 17:06:20 -0700
committerMark Otto <[email protected]>2013-03-16 17:06:20 -0700
commit71d4b5b6e7c5d1c5e3449f723de2fa7393c1a740 (patch)
tree659ddd9fadc5519e7fe3d5619082d508138eead9
parent68dfd322f42d7891cc6e41bce99bfb6cd89e1834 (diff)
parente8dc036d2522d586ae657d6102da0261c78e7e64 (diff)
downloadbootstrap-71d4b5b6e7c5d1c5e3449f723de2fa7393c1a740.tar.xz
bootstrap-71d4b5b6e7c5d1c5e3449f723de2fa7393c1a740.zip
Merge branch '3.0.0-wip' of https://github.com/dannykeane/bootstrap into dannykeane-3.0.0-wip
-rw-r--r--less/mixins.less26
1 files changed, 26 insertions, 0 deletions
diff --git a/less/mixins.less b/less/mixins.less
index 482e7e76f..3207c82ec 100644
--- a/less/mixins.less
+++ b/less/mixins.less
@@ -376,6 +376,32 @@
}
+// RETINA IMAGE SUPPORT
+// --------------------------------------------------
+
+// Retina background image support with non-retina fall back
+// Usage example can be found here: https://gist.github.com/dannykeane/4754113
+.retina-image(@file, @type, @repeat, @width, @height, @posx, @posy) {
+ background-image: url('@{file}.@{type}');
+ background-repeat: @repeat;
+ background-position: @posx @posy;
+
+ @media print,
+ screen,
+ (-webkit-min-device-pixel-ratio: 1.25),
+ (~`"-o-min-device-pixel-ratio: 1.25/1"`),
+ (min--moz-device-pixel-ratio: 1.25),
+ (-moz-min-device-pixel-ratio: 1.25),
+ (-ms-min-device-pixel-ratio: 1.25),
+ (min-device-pixel-ratio: 1.25),
+ (min-resolution: 120dpi),
+ (min-resolution: 1.25dppx) {
+ background-size: @width @height;
+ background-image: url('@{file}@2x.@{type}');
+ background-position: @posx * 2 @posy * 2;
+ }
+}
+
// COMPONENT MIXINS
// --------------------------------------------------