diff --git a/apps/common/main/resources/less/asc-mixins.less b/apps/common/main/resources/less/asc-mixins.less index 66ab63c00..aaa42ed66 100644 --- a/apps/common/main/resources/less/asc-mixins.less +++ b/apps/common/main/resources/less/asc-mixins.less @@ -231,6 +231,53 @@ } } +.background-ximage-all(@image, @w: auto, @h: auto, @repeat: no-repeat, @commonimage: true) { + .choose-image-path(@commonimage); + @imagepath: '@{path}/@{image}'; + + background-image: if(@icon-src-base64, data-uri(%("%s", '@{imagepath}')), ~"url(@{imagepath})"); + background-repeat: @repeat; + + @1d5ximage: replace(@imagepath, '\.png$', '@1.5x.png'); + @1d75ximage: replace(@imagepath, '\.png$', '@1.75x.png'); + @1d25ximage: replace(@imagepath, '\.png$', '@1.25x.png'); + @2ximage: replace(@imagepath, '\.png$', '@2x.png'); + + @media only screen { + @media (-webkit-min-device-pixel-ratio: 1.25) and (-webkit-max-device-pixel-ratio: 1.49), + (min-resolution: 1.25dppx) and (max-resolution: 1.49dppx), + (min-resolution: 120dpi) and (max-resolution: 143dpi) + { + background-image: ~"url(@{1d25ximage})"; + background-size: @w @h; + } + + @media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.74), + (min-resolution: 1.5dppx) and (max-resolution: 1.74dppx), + (min-resolution: 144dpi) and (max-resolution: 167dpi) + { + background-image: ~"url(@{1d5ximage})"; + background-size: @w @h; + } + + @media (-webkit-min-device-pixel-ratio: 1.75) and (-webkit-max-device-pixel-ratio: 1.9), + (min-resolution: 1.75dppx) and (max-resolution: 1.9dppx), + (min-resolution: 168dpi) and (max-resolution: 191dpi) + { + background-image: ~"url(@{1d75ximage})"; + background-size: @w @h; + } + + @media (-webkit-min-device-pixel-ratio: 2), + (min-resolution: 2dppx), + (min-resolution: 192dpi) + { + background-image: ~"url(@{2ximage})"; + background-size: @w @h; + } + } +} + .img-commonctrl { &.img-colored { filter: none; diff --git a/apps/common/main/resources/less/dimension-picker.less b/apps/common/main/resources/less/dimension-picker.less index 028123f3b..1098376c2 100644 --- a/apps/common/main/resources/less/dimension-picker.less +++ b/apps/common/main/resources/less/dimension-picker.less @@ -21,13 +21,13 @@ .dimension-picker-unhighlighted { //background: transparent repeat scroll 0 0; - .background-ximage-v2('dimension-picker/dimension-unhighlighted.png', 18px); + .background-ximage-all('dimension-picker/dimension-unhighlighted.png', 18px); background-repeat: repeat; } .dimension-picker div.dimension-picker-highlighted { //background: transparent repeat scroll 0 0; - .background-ximage-v2('dimension-picker/dimension-highlighted.png', 18px); + .background-ximage-all('dimension-picker/dimension-highlighted.png', 18px); background-repeat: repeat; } diff --git a/apps/documenteditor/main/resources/less/rightmenu.less b/apps/documenteditor/main/resources/less/rightmenu.less index dfd274f36..1ca355255 100644 --- a/apps/documenteditor/main/resources/less/rightmenu.less +++ b/apps/documenteditor/main/resources/less/rightmenu.less @@ -39,7 +39,7 @@ } .item-gradient { - .background-ximage-v2('right-panels/gradients.png', 150px); + .background-ximage-all('right-panels/gradients.png', 150px); width:50px; height:50px; diff --git a/apps/presentationeditor/main/resources/less/rightmenu.less b/apps/presentationeditor/main/resources/less/rightmenu.less index 80eb58d1b..67c9bab9f 100644 --- a/apps/presentationeditor/main/resources/less/rightmenu.less +++ b/apps/presentationeditor/main/resources/less/rightmenu.less @@ -33,7 +33,7 @@ } .item-gradient { - .background-ximage('@{common-image-path}/right-panels/gradients.png', '@{common-image-path}/right-panels/gradients@2x.png', 150px); + .background-ximage-all('right-panels/gradients.png', 150px); width:50px; height:50px; } diff --git a/apps/presentationeditor/main/resources/less/toolbar.less b/apps/presentationeditor/main/resources/less/toolbar.less index 077e47074..68c8b17dd 100644 --- a/apps/presentationeditor/main/resources/less/toolbar.less +++ b/apps/presentationeditor/main/resources/less/toolbar.less @@ -108,7 +108,7 @@ .item-theme { width: 88px; height: 40px; - .background-ximage-v2('../../../../../../sdkjs/common/Images/themes_thumbnail.png', 88px); + .background-ximage-all('../../../../../../sdkjs/common/Images/themes_thumbnail.png', 88px); background-size: cover } diff --git a/apps/spreadsheeteditor/main/resources/less/rightmenu.less b/apps/spreadsheeteditor/main/resources/less/rightmenu.less index d8736eef1..5eb734d6f 100644 --- a/apps/spreadsheeteditor/main/resources/less/rightmenu.less +++ b/apps/spreadsheeteditor/main/resources/less/rightmenu.less @@ -27,7 +27,7 @@ } .item-gradient { - .background-ximage('@{common-image-path}/right-panels/gradients.png', '@{common-image-path}/right-panels/gradients@2x.png', 150px); + .background-ximage-all('right-panels/gradients.png', 150px); width:50px; height:50px; }