mirror of
https://github.com/twbs/bootstrap.git
synced 2025-02-24 03:40:10 +00:00
convert to preboot's retina mixin
This commit is contained in:
parent
71d4b5b6e7
commit
ef4898990f
@ -379,26 +379,19 @@
|
|||||||
// RETINA IMAGE SUPPORT
|
// RETINA IMAGE SUPPORT
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
// Retina background image support with non-retina fall back
|
// Short retina mixin for setting background-image and -size
|
||||||
// Usage example can be found here: https://gist.github.com/dannykeane/4754113
|
.retina-image(@file-1x, @file-2x, @width-1x, @height-1x) {
|
||||||
.retina-image(@file, @type, @repeat, @width, @height, @posx, @posy) {
|
background-image: url("@{file-1x}");
|
||||||
background-image: url('@{file}.@{type}');
|
|
||||||
background-repeat: @repeat;
|
|
||||||
background-position: @posx @posy;
|
|
||||||
|
|
||||||
@media print,
|
@media
|
||||||
screen,
|
only screen and (-webkit-min-device-pixel-ratio: 2),
|
||||||
(-webkit-min-device-pixel-ratio: 1.25),
|
only screen and ( min--moz-device-pixel-ratio: 2),
|
||||||
(~`"-o-min-device-pixel-ratio: 1.25/1"`),
|
only screen and ( -o-min-device-pixel-ratio: 2/1),
|
||||||
(min--moz-device-pixel-ratio: 1.25),
|
only screen and ( min-device-pixel-ratio: 2),
|
||||||
(-moz-min-device-pixel-ratio: 1.25),
|
only screen and ( min-resolution: 192dpi),
|
||||||
(-ms-min-device-pixel-ratio: 1.25),
|
only screen and ( min-resolution: 2dppx) {
|
||||||
(min-device-pixel-ratio: 1.25),
|
background-image: url("@{file-2x}");
|
||||||
(min-resolution: 120dpi),
|
background-size: @width-1x @height-1x;
|
||||||
(min-resolution: 1.25dppx) {
|
|
||||||
background-size: @width @height;
|
|
||||||
background-image: url('@{file}@2x.@{type}');
|
|
||||||
background-position: @posx * 2 @posy * 2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user