web-apps/apps/common/main/resources/less/asc-mixins.less

339 lines
12 KiB
Plaintext
Raw Normal View History

2016-03-11 00:48:53 +00:00
*, *:before, *:after {
-moz-user-select: none;
}
:focus {
outline: none;
}
.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
background: @color;
background: -webkit-gradient(linear, left bottom,left top, color-stop(0, @start), color-stop(1, @stop));
background: -moz-linear-gradient(center bottom, @start 0%, @stop 100%);
background: -o-linear-gradient(@stop, @start);
background: linear-gradient(bottom, @start, @stop);
// filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@stop, @start));
}
.box-shadow(@arguments) {
-webkit-box-shadow: @arguments;
//-moz-box-shadow: @arguments;
box-shadow: @arguments;
}
.box-inner-shadow(@arguments) {
-webkit-box-shadow: inset @arguments;
//-moz-box-shadow: inset @arguments;
box-shadow: inset @arguments;
}
.border-radius(@radius: 2px) {
border-radius: @radius;
}
.position(@type: absolute, @left: 0, @top: 0, @right: 0, @bottom: 0) {
position: @type;
left: @left;
top: @top;
right: @right;
bottom: @bottom;
}
.fontsize(@value) {
font-size: @value;
}
// User select
.user-select(@select: none) {
-webkit-user-select: @select;
-moz-user-select: @select;
-ms-user-select: @select;
// -o-user-select: @select;
user-select: @select;
}
.toolbar-btn-icon(@icon-class, @index, @icon-size, @offset-x: 0, @offset-y: 0) {
.@{icon-class} {background-position: 0 -(@index * @icon-size - @offset-y);}
.btn.active > .@{icon-class},
.btn:active > .@{icon-class} {background-position: (-1 * @icon-size - @offset-x) -(@index * @icon-size - @offset-y);}
.btn.disabled > .@{icon-class} {background-position: (-2 * @icon-size - @offset-x) -(@index * @icon-size - @offset-y);}
}
.toolbar-group-btn-icon(@icon-class, @index, @icon-size, @offset-x: 0, @offset-y: 0) {
.@{icon-class} {background-position: 0 -(@index * @icon-size - @offset-y);}
.btn-group.open > .@{icon-class},
.btn.active > .@{icon-class},
.btn:active > .@{icon-class} {background-position: (-1 * @icon-size - @offset-x) -(@index * @icon-size - @offset-y);}
.btn.disabled > .@{icon-class} {background-position: (-2 * @icon-size - @offset-x) -(@index * @icon-size - @offset-y);}
}
.menu-btn-icon(@icon-class, @index, @icon-size) {
.menu-item-icon.@{icon-class} {background-position: 0 -@index*@icon-size;}
li > a.checked > .menu-item-icon.@{icon-class} {background-position: -1*@icon-size -@index*@icon-size;}
}
.options-btn-icon(@icon-class, @index, @icon-size) {
.@{icon-class} {background-position: 0 -@index*@icon-size;}
2016-03-11 00:48:53 +00:00
button.over > .@{icon-class} {background-position: -1*@icon-size -@index*@icon-size;}
// .btn-group.open > .@{icon-class},
button.active > .@{icon-class},
button:active > .@{icon-class} {background-position: -2*@icon-size -@index*@icon-size;}
button.disabled > .@{icon-class} {background-position: -3*@icon-size -@index*@icon-size;}
}
/**
*/
:root {
--bgX: 0px;
--pixel-ratio-factor: 1;
.pixel-ratio__1_5 {
@ratio: 1.5;
@one-px: 1px / @ratio;
Merge branch 'develop' into feature/multiZoom5.5 # Conflicts: # apps/common/main/resources/img/toolbar/1x/big/.css.handlebars # apps/common/main/resources/less/asc-mixins.less # apps/common/main/resources/less/buttons.less # apps/common/main/resources/less/checkbox.less # apps/common/main/resources/less/combo-dataview.less # apps/common/main/resources/less/comments.less # apps/common/main/resources/less/common.less # apps/common/main/resources/less/dataview.less # apps/common/main/resources/less/dropdown-menu.less # apps/common/main/resources/less/listview.less # apps/common/main/resources/less/multislider-gradient.less # apps/common/main/resources/less/radiobox.less # apps/common/main/resources/less/scroller.less # apps/common/main/resources/less/separator.less # apps/common/main/resources/less/theme-colorpalette.less # apps/common/main/resources/less/toolbar.less # apps/common/main/resources/less/window.less # apps/documenteditor/main/resources/less/advanced-settings.less # apps/documenteditor/main/resources/less/filemenu.less # apps/documenteditor/main/resources/less/leftmenu.less # apps/documenteditor/main/resources/less/rightmenu.less # apps/documenteditor/main/resources/less/statusbar.less # apps/documenteditor/main/resources/less/toolbar.less # apps/presentationeditor/main/resources/less/leftmenu.less # apps/presentationeditor/main/resources/less/rightmenu.less # apps/presentationeditor/main/resources/less/statusbar.less # apps/spreadsheeteditor/main/resources/less/celleditor.less # apps/spreadsheeteditor/main/resources/less/leftmenu.less # apps/spreadsheeteditor/main/resources/less/rightmenu.less # apps/spreadsheeteditor/main/resources/less/statusbar.less # apps/spreadsheeteditor/main/resources/less/toolbar.less
2021-02-10 12:40:30 +00:00
@two-px: 2px / @ratio;
--pixel-ratio-factor: @ratio;
--scaled-one-pixel: @one-px;
Merge branch 'develop' into feature/multiZoom5.5 # Conflicts: # apps/common/main/resources/img/toolbar/1x/big/.css.handlebars # apps/common/main/resources/less/asc-mixins.less # apps/common/main/resources/less/buttons.less # apps/common/main/resources/less/checkbox.less # apps/common/main/resources/less/combo-dataview.less # apps/common/main/resources/less/comments.less # apps/common/main/resources/less/common.less # apps/common/main/resources/less/dataview.less # apps/common/main/resources/less/dropdown-menu.less # apps/common/main/resources/less/listview.less # apps/common/main/resources/less/multislider-gradient.less # apps/common/main/resources/less/radiobox.less # apps/common/main/resources/less/scroller.less # apps/common/main/resources/less/separator.less # apps/common/main/resources/less/theme-colorpalette.less # apps/common/main/resources/less/toolbar.less # apps/common/main/resources/less/window.less # apps/documenteditor/main/resources/less/advanced-settings.less # apps/documenteditor/main/resources/less/filemenu.less # apps/documenteditor/main/resources/less/leftmenu.less # apps/documenteditor/main/resources/less/rightmenu.less # apps/documenteditor/main/resources/less/statusbar.less # apps/documenteditor/main/resources/less/toolbar.less # apps/presentationeditor/main/resources/less/leftmenu.less # apps/presentationeditor/main/resources/less/rightmenu.less # apps/presentationeditor/main/resources/less/statusbar.less # apps/spreadsheeteditor/main/resources/less/celleditor.less # apps/spreadsheeteditor/main/resources/less/leftmenu.less # apps/spreadsheeteditor/main/resources/less/rightmenu.less # apps/spreadsheeteditor/main/resources/less/statusbar.less # apps/spreadsheeteditor/main/resources/less/toolbar.less
2021-02-10 12:40:30 +00:00
--scaled-two-pixel: @two-px;
}
.pixel-ratio__2 {
}
2021-08-09 19:26:06 +00:00
.pixel-ratio__1_25 {
@ratio: 1.25;
@one-px: 1px / @ratio;
@two-px: 2px / @ratio;
--pixel-ratio-factor: @ratio;
--scaled-one-pixel: @one-px;
--scaled-two-pixel: @two-px;
}
.pixel-ratio__1_75 {
@ratio: 1.75;
@one-px: 1px / @ratio;
@two-px: 2px / @ratio;
--pixel-ratio-factor: @ratio;
--scaled-one-pixel: @one-px;
--scaled-two-pixel: @two-px;
}
2016-03-11 00:48:53 +00:00
}
.button-normal-icon(@icon-class, @index, @icon-size, @normal-h-offset: 0px) {
2016-03-11 00:48:53 +00:00
.@{icon-class} {
background-position: -0*@icon-size -@index*@icon-size;
background-position: @normal-h-offset -@index*@icon-size;
2016-03-11 00:48:53 +00:00
}
// .@{icon-class} {background-position-y: -@index*@icon-size;}
}
.button-otherstates-icon(@icon-class, @icon-size) {
2019-12-02 16:26:04 +00:00
.btn {
&:active, &.active {
&:not(:disabled):not(.disabled) {
2019-12-02 16:26:04 +00:00
> .@{icon-class} {
@iconsize: -1*@icon-size;
background-position-x: @iconsize;
--bgX: @iconsize;
}
}
}
}
2016-03-11 00:48:53 +00:00
}
.mx-button-otherstates-icon2(@offset) {
&.active, &:active{
&:not(:disabled):not(.disabled) {
2019-10-25 14:22:27 +00:00
.icon {
background-position-x: @offset;
2019-10-25 14:22:27 +00:00
}
}
}
//&.active svg.icon,
//&:active svg.icon {fill:#fff;}
2017-06-26 09:19:08 +00:00
}
2016-03-11 00:48:53 +00:00
.button-otherstates-icon2(@icon-class, @icon-size) {
2017-06-26 09:19:08 +00:00
button.@{icon-class} {
.mx-button-otherstates-icon2(@icon-size);
}
2016-03-11 00:48:53 +00:00
}
.menu-icon-normal(@icon-class, @index, @icon-size) {
.menu-item-icon.@{icon-class} {
background-position: 0 -@index*@icon-size;
background-position: var(--bgX) -@index*@icon-size;
}
// .menu-item-icon.@{icon-class} {background-position-y: -@index*@icon-size;}
}
.menu-otherstates-icon(@menu-class, @icon-size) {
.@{menu-class} li > a.checked > .menu-item-icon {background-position-x: -1*@icon-size; --bgX: calc(-1*@icon-size);}
.@{menu-class} li.disabled .menu-item-icon {background-position-x: -2*@icon-size; --bgX: calc(-2*@icon-size);}
2016-03-11 00:48:53 +00:00
}
/**/
.background-ximage(@image, @image2x, @w: auto, @h: auto, @repeat: no-repeat) {
2016-11-10 11:57:07 +00:00
background-image: data-uri(%("%s",@image));
background-repeat: @repeat;
2016-03-11 00:48:53 +00:00
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-resolution: 2dppx),
only screen and (min-resolution: 192dpi) {
2016-11-10 11:57:07 +00:00
background-image: data-uri(%("%s",@image2x));
2016-03-11 00:48:53 +00:00
background-size: @w @h;
}
}
2019-10-21 14:05:50 +00:00
.choose-image-path(@fromcommon) when (@fromcommon = false) {
@path: if(@icon-src-base64, @app-image-path, @app-image-const-path);
};
.choose-image-path(@fromcommon) when (@fromcommon = true) {
@path: if(@icon-src-base64, @common-image-path, @common-image-const-path);
}
.background-ximage-v2(@image, @w: auto, @h: auto, @repeat: no-repeat, @commonimage: true) {
.choose-image-path(@commonimage);
2019-10-21 15:05:10 +00:00
@imagepath: '@{path}/@{image}';
2019-10-21 14:05:50 +00:00
2019-10-21 15:05:10 +00:00
background-image: if(@icon-src-base64, data-uri(%("%s", '@{imagepath}')), ~"url(@{imagepath})");
background-repeat: @repeat;
2019-10-21 15:05:10 +00:00
@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.5) and (-webkit-max-device-pixel-ratio: 1.9),
(min-resolution: 1.5dppx) and (max-resolution: 1.9dppx),
(min-resolution: 144dpi) and (max-resolution: 191dpi)
{
background-image: ~"url(@{1d5ximage})";
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;
}
}
2016-03-11 00:48:53 +00:00
@common-controls-width: 100px;
2021-03-05 21:53:29 +00:00
.img-commonctrl,
2020-12-25 11:50:01 +00:00
.dropdown-menu li .checked:before, .input-error:before, .input-warning:before,
2019-10-21 14:05:50 +00:00
.btn-toolbar .icon.img-commonctrl, .list-item div.checked:before
{
background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/@{common-controls}')), ~"url(@{common-image-const-path}/@{common-controls})");
2016-11-09 11:36:29 +00:00
background-repeat: no-repeat;
2021-03-05 21:53:29 +00:00
filter: @component-normal-icon-filter;
2016-03-11 00:48:53 +00:00
2019-10-21 14:05:50 +00:00
@1d5ximage: replace(@common-controls, '\.png$', '@1.5x.png');
@2ximage: replace(@common-controls, '\.png$', '@2x.png');
@media only screen {
@media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9),
(min-resolution: 1.5dppx) and (max-resolution: 1.9dppx),
(min-resolution: 144dpi) and (max-resolution: 191dpi)
{
background-image: ~"url(@{common-image-const-path}/@{1d5ximage})";
background-size: @common-controls-width auto;
}
2019-10-21 14:05:50 +00:00
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 2dppx),
(min-resolution: 192dpi)
{
background-image: ~"url(@{common-image-const-path}/@{2ximage})";
background-size: @common-controls-width auto;
}
2016-03-11 00:48:53 +00:00
}
}
@img-colorpicker-width: 205px;
2019-12-06 15:17:41 +00:00
.img-colorpicker, .hsb-colorpicker .empty-color:before
2019-10-21 14:05:50 +00:00
{
background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/hsbcolorpicker/hsb-colorpicker.png')), ~"url(@{common-image-const-path}/hsbcolorpicker/hsb-colorpicker.png)");
background-repeat: no-repeat;
2016-03-11 00:48:53 +00:00
2019-10-21 14:05:50 +00:00
@media only screen {
@media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9),
(min-resolution: 1.5dppx) and (max-resolution: 1.9dppx),
(min-resolution: 144dpi) and (max-resolution: 191dpi)
{
background-image: ~"url(@{common-image-const-path}/hsbcolorpicker/hsb-colorpicker@1.5x.png)";
background-size: @img-colorpicker-width auto;
}
2019-10-21 14:05:50 +00:00
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 2dppx),
(min-resolution: 192dpi)
{
background-image: ~"url(@{common-image-const-path}/hsbcolorpicker/hsb-colorpicker@2x.png)";
background-size: @img-colorpicker-width auto;
}
2016-03-11 00:48:53 +00:00
}
}
.icon.lang-flag {
2019-10-21 14:05:50 +00:00
@img-flags-width: 48px;
width: 16px;
height: 12px;
2019-10-21 14:05:50 +00:00
background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/controls/flags.png')), ~"url(@{common-image-const-path}/controls/flags.png)");
background-repeat: no-repeat;
2019-10-21 14:05:50 +00:00
@media only screen {
@media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9),
(min-resolution: 1.5dppx) and (max-resolution: 1.9dppx),
(min-resolution: 144dpi) and (max-resolution: 191dpi)
{
background-image: ~"url(@{common-image-const-path}/controls/flags@1.5x.png)";
background-size: @img-flags-width auto;
}
2019-10-21 14:05:50 +00:00
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 2dppx),
(min-resolution: 192dpi)
{
background-image: ~"url(@{common-image-const-path}/controls/flags@2x.png)";
background-size: @img-flags-width auto;
}
}
2020-03-17 12:19:42 +00:00
}
Merge branch 'develop' into feature/multiZoom5.5 # Conflicts: # apps/common/main/resources/img/toolbar/1x/big/.css.handlebars # apps/common/main/resources/less/asc-mixins.less # apps/common/main/resources/less/buttons.less # apps/common/main/resources/less/checkbox.less # apps/common/main/resources/less/combo-dataview.less # apps/common/main/resources/less/comments.less # apps/common/main/resources/less/common.less # apps/common/main/resources/less/dataview.less # apps/common/main/resources/less/dropdown-menu.less # apps/common/main/resources/less/listview.less # apps/common/main/resources/less/multislider-gradient.less # apps/common/main/resources/less/radiobox.less # apps/common/main/resources/less/scroller.less # apps/common/main/resources/less/separator.less # apps/common/main/resources/less/theme-colorpalette.less # apps/common/main/resources/less/toolbar.less # apps/common/main/resources/less/window.less # apps/documenteditor/main/resources/less/advanced-settings.less # apps/documenteditor/main/resources/less/filemenu.less # apps/documenteditor/main/resources/less/leftmenu.less # apps/documenteditor/main/resources/less/rightmenu.less # apps/documenteditor/main/resources/less/statusbar.less # apps/documenteditor/main/resources/less/toolbar.less # apps/presentationeditor/main/resources/less/leftmenu.less # apps/presentationeditor/main/resources/less/rightmenu.less # apps/presentationeditor/main/resources/less/statusbar.less # apps/spreadsheeteditor/main/resources/less/celleditor.less # apps/spreadsheeteditor/main/resources/less/leftmenu.less # apps/spreadsheeteditor/main/resources/less/rightmenu.less # apps/spreadsheeteditor/main/resources/less/statusbar.less # apps/spreadsheeteditor/main/resources/less/toolbar.less
2021-02-10 12:40:30 +00:00
//.adaptive-solid-border(@width, @color, @borderside: all) {
// @lb-border: if((@borderside = all), border, e('border-@{borderside}'));
// @lb-border-width: if((@borderside = all), border-width, e('border-@{borderside}-width'));
//
// @{lb-border}: @width solid @color;
//
// @media only screen {
// @media (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9),
// (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx),
// (min-resolution: 144dpi) and (max-resolution: 191dpi)
// {
// @{lb-border-width}: (@width / 1.5);
// }
// }
//}