web-apps/apps/common/main/resources/less/buttons.less

903 lines
19 KiB
Plaintext
Raw Normal View History

2017-07-11 08:26:42 +00:00
@x-huge-btn-height: 46px;
@btn-disabled-opacity: .4;
@x-huge-btn-icon-size: 28px;
2017-07-11 08:26:42 +00:00
2016-03-11 00:48:53 +00:00
.btn {
border-radius: 1px;
color: @text-normal;
2016-03-11 00:48:53 +00:00
.btnsize(@value) {
min-width: @value;
height: @value;
line-height: @value - 2px;
}
&.small {
.btnsize(20px);
}
&.normal {
height: 22px;
}
&.large {
.btnsize(31px);
}
&.huge {
.btnsize(37px);
}
2019-12-17 12:15:19 +00:00
&.huge-1 {
.btnsize(45px);
}
2016-03-11 00:48:53 +00:00
&.x-huge {
2017-07-11 08:26:42 +00:00
.btnsize(@x-huge-btn-height);
2016-03-11 00:48:53 +00:00
}
&[disabled] {
opacity: @btn-disabled-opacity;
2016-03-11 00:48:53 +00:00
}
&:focus {
outline: 0;
outline-offset: 0;
}
&:active, &.active {
-webkit-box-shadow: none;
box-shadow: none;
}
.caret {
width: 7px;
height: 7px;
border: 0;
background-position: @arrow-small-offset-x @arrow-small-offset-y;
position: relative;
}
//&:active,
&:active:not(.disabled),
&.active:not(.disabled){
.caret {
background-position: @arrow-small-offset-x - 7px @arrow-small-offset-y;
}
}
2016-11-03 10:41:44 +00:00
&:active,
&.active {
&:focus,
&.focus {
outline: none;
}
}
&.icon-top {
display: inline-flex;
flex-direction: column;
align-items: center;
.icon {
2017-08-09 16:58:47 +00:00
//flex-grow: 1;
}
.caption {
line-height: 18px;
2017-07-03 15:27:50 +00:00
padding: 0 4px;
}
}
2019-11-20 09:42:39 +00:00
&.notify {
.icon {
&::after {
content: ' ';
position: absolute;
border: 1px solid #000;
border-left: 0 none;
border-right: 0 none;
width: 6px;
height: 3px;
bottom: 4px;
right: 2px;
}
&::before {
content: ' ';
position: absolute;
width: 10px;
height: 7px;
bottom: 2px;
background-color: #ffd112;
border-radius: 2px;
right: 0;
}
}
}
.icon {
&.caret-up, &.caret-down {
&::after {
content: '';
position: absolute;
left: 6px;
width: 8px;
height: 8px;
background-color: transparent;
border: solid 1px @text-normal;
border-bottom: none;
border-right: none;
}
}
&.caret-up {
&::after {
top: 8px;
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
}
&.caret-down {
&::after {
top: 4px;
-moz-transform: rotate(225deg);
-ms-transform: rotate(225deg);
-webkit-transform: rotate(225deg);
-o-transform: rotate(225deg);
transform: rotate(225deg);
}
}
}
&:active:not(.disabled),
&.active:not(.disabled) {
.caret-up, .caret-down {
&::after {
border-color: #FFFFFF;
}
}
}
}
2017-06-26 12:47:54 +00:00
.btn.icon-top, .btn-group.icon-top {
display: inline-flex;
flex-direction: column;
&.open,
&.over {
&.split {
> .inner-box-icon {
.box-shadow(none);
}
}
}
2017-07-11 08:26:42 +00:00
&.x-huge {
@icon-size: 28px;
2017-06-26 12:47:54 +00:00
min-width: 45px;
2017-07-11 08:26:42 +00:00
height: @x-huge-btn-height;
2017-03-13 16:14:26 +00:00
img {
height: 27px;
}
2017-06-26 12:47:54 +00:00
.inner-box-caption {
line-height: 18px;
2017-07-03 15:27:50 +00:00
padding: 0 4px;
display: flex;
align-items: center;
.caption {
max-width: 107px;
text-overflow: ellipsis;
overflow: hidden;
}
2017-06-26 12:47:54 +00:00
}
.icon:not(svg) {
width: @x-huge-btn-icon-size;
height: @x-huge-btn-icon-size;
2017-06-26 12:47:54 +00:00
min-width: 0;
}
svg.icon {
width: 28px;
height: 28px;
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (min-resolution: 1.5dppx),
only screen and (min-resolution: 144dpi) {
width:calc(~"40px/1.5");
height:calc(~"40px/1.5");
}
}
button.small .icon {
width: 20px;
height: 20px;
min-width: 0;
}
&.dropdown-toggle {
.caption {
max-width: 100px;
}
}
}
.inner-box-icon {
flex-grow: 1;
display: flex;
align-items: center;
justify-content: center;
line-height: 20px;
}
2017-08-15 11:26:40 +00:00
.btn-fixflex-hcenter {
flex-grow: 1;
}
.btn-fixflex-vcenter {
display: flex;
align-items: center;
2017-08-15 11:26:40 +00:00
.caret {
vertical-align: inherit;
}
}
.inner-box-caption {
margin: 0;
height: 18px;
}
2017-08-09 16:58:47 +00:00
div.inner-box-icon {
2017-08-15 11:26:40 +00:00
height: 28px; // TODO: clear. Firefox bug 984869. fixed. isn't released.
2017-08-09 16:58:47 +00:00
}
}
2017-06-26 12:47:54 +00:00
.icon-top {
&.x-huge {
.btn&, .btn-group& .btn-toolbar {
.mx-button-otherstates-icon2(@x-huge-btn-icon-size);
}
2017-06-26 12:47:54 +00:00
.btn.small {
.mx-button-otherstates-icon2(20px);
}
}
2016-03-11 00:48:53 +00:00
}
.btn-toolbar {
display: inline-block;
position: relative;
margin: 0;
padding: 0;
border: 0;
.border-radius(1px);
background-color: transparent;
.btn.small;
2019-08-02 10:56:21 +00:00
&.bg-white {
background-color: #fff;
}
2016-03-11 00:48:53 +00:00
&:before,
&:after {
content: "";
display: none;
}
2016-11-03 10:41:44 +00:00
&:hover:not(.disabled),
.over:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @secondary;
}
&:active:not(.disabled),
&.active:not(.disabled) {
color: @text-normal;
2016-03-11 00:48:53 +00:00
background-color: @primary;
}
&:not(.icon-top)
2017-03-06 09:02:32 +00:00
.caption:not(:empty) {
2020-07-22 13:03:12 +00:00
padding: 0 4px;
2017-03-06 09:02:32 +00:00
}
2017-03-09 08:41:47 +00:00
.icon {
2016-03-11 00:48:53 +00:00
padding: 0;
margin: 0;
2017-03-06 09:02:32 +00:00
display: inline-block;
2016-03-11 00:48:53 +00:00
background-repeat: no-repeat;
2017-07-03 15:27:50 +00:00
}
2016-03-11 00:48:53 +00:00
2017-07-03 15:27:50 +00:00
&:not(.x-huge) {
.icon {
2017-06-26 12:47:54 +00:00
width: 20px;
height: 20px;
line-height: 20px;
}
svg.icon {
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5) and (-webkit-max-device-pixel-ratio: 1.9),
only screen and (min-resolution: 1.5dppx) and (max-resolution: 1.9dppx),
only screen and (min-resolution: 144dpi) and (max-resolution: 143dpi) {
width:calc(~"28px/1.5");
height:calc(~"28px/1.5");
}
}
2017-06-26 12:47:54 +00:00
}
2016-03-11 00:48:53 +00:00
&.dropdown-toggle {
min-width: 7px;
}
// Large size
// ------------------------
&.large {
2017-03-09 08:41:47 +00:00
.icon {
2016-03-11 00:48:53 +00:00
width: 30px !important;
height: 30px;
line-height: 20px;
}
}
// Button has color line
// ------------------------
.btn-color-value-line {
pointer-events: none;
position: absolute;
left: 3px;
2019-11-29 12:33:16 +00:00
bottom: 1px;
2016-03-11 00:48:53 +00:00
width: 14px;
height: 3px;
background-color: red;
}
}
.btn-category {
.btn.large;
width: 100%;
padding: 0;
display: block;
position: relative;
.border-radius(0);
background-color: transparent;
font-weight: bold;
2016-11-03 10:41:44 +00:00
&:hover:not(.disabled),
.over:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @secondary;
}
2016-04-21 10:15:15 +00:00
&:active:not(.disabled),
&.active:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @primary;
color: #fff;
}
2017-03-09 08:41:47 +00:00
.icon {
2016-03-11 00:48:53 +00:00
display: inline-block;
position: relative;
width: 20px;
height: 20px;
line-height: 20px;
}
&[disabled],
&.disabled {
color: #000;
opacity: @btn-disabled-opacity;
2016-03-11 00:48:53 +00:00
}
}
// The clickable button for toggling the menu
// Remove the gradient and set the same inset shadow as the :active state
.btn-group {
> .btn-toolbar {
float: none;
2017-07-03 15:27:50 +00:00
}
> .btn {
+ .dropdown-toggle {
padding: 0 2px;
}
}
> .dropdown-toggle:first-child {
2017-07-11 08:26:42 +00:00
.inner-box-caret {
padding: 0 2px;
2017-07-03 15:27:50 +00:00
}
}
2016-03-11 00:48:53 +00:00
2017-07-03 15:27:50 +00:00
.caption {
&:empty {
display: none;
+ .caret {
margin-left: 2px;
}
2016-03-11 00:48:53 +00:00
}
}
&.open {
> .btn-toolbar {
//color: @text-normal;
2016-03-11 00:48:53 +00:00
// Show no shadow for `.btn-link` since it has no other button styles.
&.btn-link {
.box-shadow(none);
}
}
.dropdown-toggle {
.box-shadow(none);
}
}
&.over {
> button {
//background-color: @secondary;
2016-03-11 00:48:53 +00:00
}
}
&:not(.split) {
.btn-toolbar {
&.dropdown-toggle:not(.x-huge) {
2016-03-11 00:48:53 +00:00
width: 100%;
min-width: 28px;
}
&.btn-text-value {
.caret {
margin: 6px 3px 6px 0;
}
.caption {
vertical-align: middle;
}
&[disabled],
&.disabled {
opacity: 0.65;
}
}
&.large {
&.dropdown-toggle {
min-width: 40px;
.caret {
float: right;
}
}
}
}
2019-10-21 14:43:34 +00:00
.dropdown-menu {
&.scale-menu {
li.disabled {
opacity: 0.65;
}
2019-10-21 14:43:34 +00:00
}
}
2016-03-11 00:48:53 +00:00
}
@color-gray: @secondary;
@color-dark: @primary;
//@color-gray: #079e2f;
//@color-dark: #c52c0e;
&.split {
2019-05-24 09:58:06 +00:00
&.over:not(.disabled),
&.open {
box-shadow: inset 0 0 0 1px @color-gray;
2019-04-05 14:36:15 +00:00
button:not(.active):not(.btn-text-split-default) {
background-color: transparent;
}
}
2019-05-24 09:58:06 +00:00
&.over:not(.disabled) {
button {
&:not(.active) {
&:hover {
background-color: @color-gray;
}
}
&:active,
&:active:hover {
background-color: @color-dark;
}
}
}
&.open {
2017-04-03 16:20:12 +00:00
> button:not(.active) {
&:last-of-type {
background-color: @color-dark;
}
}
.caret {
background-position: @arrow-small-offset-x - 7px @arrow-small-offset-y;
}
}
2017-08-09 11:37:27 +00:00
button.active:not(.disabled) {
background-color: @color-dark;
}
.btn + .btn {
margin: 0;
}
}
2016-03-11 00:48:53 +00:00
}
.btn-color {
2020-04-29 19:15:22 +00:00
width: 45px;
2020-04-28 15:10:49 +00:00
height: 22px;
padding: 1px 11px 1px 1px;
2016-03-11 00:48:53 +00:00
border:1px solid @input-border;
.border-radius(@border-radius-small);
2020-04-28 15:10:49 +00:00
span:nth-child(1) {
float: left;
width: 100%;
height: 100%;
border: 1px solid rgba(0, 0, 0, 0.2);
2016-03-11 00:48:53 +00:00
background-color: transparent;
}
2020-04-28 15:10:49 +00:00
.inner-box-caret {
position: absolute;
right: 0;
top: 2px;
}
2016-03-11 00:48:53 +00:00
&,
&:hover,
.over,
&:active,
&.active {
background: #fff !important;
.box-shadow(none) !important;
}
&[disabled],
&.disabled {
opacity: 0.35;
}
.color-transparent {
2019-12-06 15:17:41 +00:00
&:before {
2020-04-28 15:10:49 +00:00
border-right: 1px solid red;
height: 34px;
transform: translate(16px, -9px) rotate(62deg);
2019-12-11 16:03:06 +00:00
left: 0;
2019-12-06 15:17:41 +00:00
}
2016-03-11 00:48:53 +00:00
}
2020-04-28 15:10:49 +00:00
&:active:not(.disabled),
&.active:not(.disabled) {
.caret {
background-position: @arrow-small-offset-x @arrow-small-offset-y;
}
}
2016-03-11 00:48:53 +00:00
}
.btn-options {
padding: 0;
margin:0;
border: 0 none;
.box-shadow(none);
background-color: transparent;
2019-12-17 12:15:19 +00:00
&.bg-white {
background-color: #fff;
}
2017-03-09 08:41:47 +00:00
.icon {
2016-03-11 00:48:53 +00:00
position: relative;
min-width: inherit;
height: inherit;
line-height: inherit;
padding: 0;
margin: 0;
display: inline-block;
background-repeat: no-repeat;
}
box-shadow: inset 0 0 0 1px @border-regular-control;
2019-12-02 16:26:04 +00:00
.border-radius(@border-radius-small);
2016-03-11 00:48:53 +00:00
&:hover,
2019-12-02 16:26:04 +00:00
&.over {
background-color: @secondary;
}
2016-03-11 00:48:53 +00:00
&:active,
&.active {
2019-12-02 16:26:04 +00:00
background-color: @primary;
2016-03-11 00:48:53 +00:00
}
}
.btn-text-default {
width: 75px;
height: 22px;
background: @input-bg;
border: 1px solid @input-border;
.border-radius(@border-radius-small);
2018-02-27 11:55:58 +00:00
&.auto {
width: auto;
padding-left: 10px;
padding-right: 10px;
}
2016-11-03 10:41:44 +00:00
&:hover:not(.disabled),
.over:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @secondary !important;
}
2016-11-03 10:41:44 +00:00
&:active:not(.disabled),
&.active:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @primary !important;
2018-02-27 11:55:58 +00:00
border-color: @primary;
2016-03-11 00:48:53 +00:00
color: white;
}
&[disabled],
&.disabled {
opacity: 0.65;
}
}
.btn-text-menu-default {
width: 100%;
height: 22px;
background: @input-bg;
border: 1px solid @input-border;
.border-radius(@border-radius-small);
button {
width: 100%;
}
.caret {
position: absolute;
right: 3px;
margin-top: 5px;
}
2016-11-03 10:41:44 +00:00
&:hover:not(.disabled),
.over:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @secondary !important;
}
2016-11-03 10:41:44 +00:00
&:active:not(.disabled),
&.active:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @primary !important;
color: white;
}
&[disabled],
&.disabled {
opacity: 0.65;
}
}
2019-04-05 14:36:15 +00:00
.btn-text-split-default {
width: 75px;
height: 22px;
background: @input-bg;
border: 1px solid @input-border;
.border-radius(@border-radius-small);
&.dropdown-toggle {
width: 13px;
}
&:not(.dropdown-toggle) {
border-right: none;
}
&:hover:not(.disabled),
.over:not(.disabled) {
background-color: @secondary !important;
}
&:active:not(.disabled),
&.active:not(.disabled) {
background-color: @primary !important;
border-color: @primary;
color: white;
}
&[disabled],
&.disabled {
opacity: 0.65;
}
}
2016-03-11 00:48:53 +00:00
.btn-icon-default {
width: 45px;
height: 22px;
background: @input-bg;
border: 1px solid @input-border;
.border-radius(@border-radius-small);
2017-03-09 08:41:47 +00:00
.icon {
2016-03-11 00:48:53 +00:00
width: 28px;
padding: 0;
margin: 0;
position: relative;
display: inline-block;
background-repeat: no-repeat;
}
2017-08-15 11:11:12 +00:00
&.dropdown-toggle:first-child .inner-box-caret {
padding: 0 2px 0 0;
}
2016-11-03 10:41:44 +00:00
&:hover:not(.disabled),
.over:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @secondary !important;
}
2016-11-03 10:41:44 +00:00
&:active:not(.disabled),
&.active:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @primary !important;
}
&[disabled],
&.disabled {
opacity: 0.65;
}
}
.btn-large-dataview {
display: inline-block;
width: 72px;
height: 58px;
padding: 2px;
margin:0;
box-shadow: none;
background-color: @input-bg;
border: 1px solid @input-border;
.border-radius(@border-radius-small);
2019-12-13 12:20:13 +00:00
&.template-table {
2019-12-16 10:55:13 +00:00
width: 92px;
}
&.sheet-template-table {
width: 83px;
height: 54px;
2019-12-13 12:20:13 +00:00
}
2020-05-27 15:34:15 +00:00
.icon-template-slicer.icon {
min-width: 36px;
height: 55px;
line-height: 53px;
border: none;
}
2017-03-09 08:41:47 +00:00
.icon {
2016-03-11 00:48:53 +00:00
display: inline-block;
.btn.btnsize(52px);
padding: 0;
margin-right: 3px;
background-color: transparent;
background-repeat: no-repeat;
border: 1px solid @input-border;
position: relative;
}
2020-05-06 14:17:03 +00:00
svg.icon {
vertical-align: middle;
width: 52px;
padding: 5px;
}
2016-03-11 00:48:53 +00:00
&:hover,
.over,
&:active,
&.active {
background-color: @input-bg !important;
}
&:active:not(.disabled),
&.active:not(.disabled) {
.caret {
background-position: @arrow-small-offset-x @arrow-small-offset-y;
}
}
&[disabled],
&.disabled {
opacity: 0.65;
}
}
// Dialog buttons
// ------------------------
.dlg-btn {
font-weight: bold;
width: 86px;
color: @text-normal;
2016-03-11 00:48:53 +00:00
background-color: @secondary;
&:hover:not(.disabled),
&.hover:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @secondary-hover;
}
&.primary {
color: #fff;
background-color: @primary;
&:hover:not(.disabled),
&.hover:not(.disabled) {
2016-03-11 00:48:53 +00:00
background-color: @primary-hover;
}
}
&[disabled] {
opacity: 0.65;
}
&.custom {
width: auto;
min-width: 86px;
}
}
2018-02-01 14:15:56 +00:00
@class100: zoom-int;
@class150: zoom-grit;
svg.icon {
.@{class150} {
display: none;
}
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-webkit-min-device-pixel-ratio: 2.5),
only screen and (min-resolution: 1.5dppx),
only screen and (min-resolution: 2.5dppx),
only screen and (min-resolution: 144dpi),
only screen and (min-resolution: 240dpi) {
.@{class100} {
display: none;
}
.@{class150} {
display: block;
}
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (-webkit-max-device-pixel-ratio: 2.4),
only screen and (-webkit-min-device-pixel-ratio: 4),
only screen and (min-resolution: 2dppx) and (max-resolution: 2.4dppx),
only screen and (min-resolution: 4dppx),
only screen and (min-resolution: 192dpi) and (max-resolution: 239dpi),
only screen and (min-resolution: 384dpi) {
.@{class100} {
display: block;
}
.@{class150} {
display: none;
}
}
}