cryptpad/customize.dist/src/less2/include/checkmark.less

216 lines
6.7 KiB
Plaintext
Raw Normal View History

@import (reference) "./colortheme-all.less";
2018-03-13 10:31:08 +00:00
.checkmark_vars(
@size: 20px
) {
@checkmark-size: @size;
@checkmark-width: round(@size / 8);
@checkmark-dim1: round(@size / 3);
@checkmark-dim2: round(2 * @size / 3);
@checkmark-top: round(@size / 12) - 1;
@checkmark-radio-size: @checkmark-dim1 * 3;
}
.checkmark_main(@size: 20px) {
2018-07-14 13:15:23 +00:00
--LessLoader_require: LessLoader_currentFile();
.checkmark_vars(@size);
--checkmark-size: @checkmark-size;
--checkmark-width: @checkmark-width;
--checkmark-dim1: @checkmark-dim1;
--checkmark-dim2: @checkmark-dim2;
--checkmark-top: @checkmark-top;
--checkmark-radio-size: @checkmark-radio-size;
2018-07-14 13:15:23 +00:00
}
& {
.checkmark_vars();
2018-03-13 10:31:08 +00:00
// <label.cp-checkmark><input><span.cp-checkmark-mark></span>Text</label>
.cp-checkmark {
margin: 0;
display: flex;
align-items: center;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
& > a {
margin-left: 0.25em;
}
2018-03-13 10:31:08 +00:00
&.cp-checkmark-secondary {
.cp-checkmark-mark {
&:after {
border-color: @colortheme_checkmark-col2;
}
}
input {
&:checked ~ .cp-checkmark-mark {
background-color: @colortheme_checkmark-back2;
border-color: @colortheme_checkmark-back2;
2018-03-13 10:31:08 +00:00
}
&:disabled ~ .cp-checkmark-mark {
background-color: @colortheme_checkmark-disabled;
}
&:disabled ~ .cp-checkmark-label {
color: @colortheme_checkmark-disabled;
}
2018-03-13 10:31:08 +00:00
}
}
&:hover .cp-checkmark-mark {
background-color: @colortheme_checkmark-back0-active;
}
input {
display: none;
&:checked ~ .cp-checkmark-mark {
background-color: @colortheme_checkmark-back1;
border-color: @colortheme_checkmark-back1;
2018-03-13 10:31:08 +00:00
&:after {
display: block;
}
}
&:disabled ~ .cp-checkmark-mark {
background-color: @colortheme_checkmark-disabled;
}
&:disabled ~ .cp-checkmark-label {
color: @colortheme_checkmark-disabled;
}
2018-03-13 10:31:08 +00:00
}
2018-04-18 12:19:45 +00:00
.cp-checkmark-label {
2018-04-19 09:14:22 +00:00
cursor: default;
2018-04-18 12:19:45 +00:00
&:empty {
display: none;
}
}
2018-03-13 10:31:08 +00:00
.cp-checkmark-mark {
margin-right: 10px;
position: relative;
height: @checkmark-size;
2018-07-14 13:15:23 +00:00
height: var(--checkmark-size);
width: @checkmark-size;
2018-07-14 13:15:23 +00:00
width: var(--checkmark-size);
2018-03-13 10:31:08 +00:00
background-color: @colortheme_checkmark-back0;
display: flex;
justify-content: center;
2018-04-11 16:56:03 +00:00
border: 1px solid @colortheme_form-border;
2018-04-16 17:07:54 +00:00
flex-shrink: 0;
2018-03-13 10:31:08 +00:00
&:after {
content: "";
display: none;
margin-top: @checkmark-top;
2018-07-14 13:15:23 +00:00
margin-top: var(--checkmark-top);
width: @checkmark-dim1;
2018-07-14 13:15:23 +00:00
width: var(--checkmark-dim1);
height: @checkmark-dim2;
2018-07-14 13:15:23 +00:00
height: var(--checkmark-dim2);
2018-03-13 10:31:08 +00:00
transform: rotate(45deg);
border: solid @colortheme_checkmark-col1;
border-width: 0 @checkmark-width @checkmark-width 0;
2018-07-14 13:15:23 +00:00
border-width: 0 var(--checkmark-width) var(--checkmark-width) 0;
2018-04-18 12:19:45 +00:00
position: absolute;
2018-03-13 10:31:08 +00:00
}
&:focus {
//border-color: #FF007C !important;
box-shadow: 0px 0px 5px @colortheme_checkmark-back1;
outline: none;
}
2018-03-13 10:31:08 +00:00
}
}
2018-04-16 17:07:54 +00:00
.cp-radio {
margin: 0;
display: flex;
align-items: center;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
&.cp-radio-secondary {
.cp-radio-mark {
&:after {
border-color: @colortheme_checkmark-col2;
}
}
input {
&:checked ~ .cp-radio-mark {
background-color: @colortheme_checkmark-back2;
}
&:disabled ~ .cp-checkmark-mark {
background-color: @colortheme_checkmark-disabled;
}
&:disabled ~ .cp-checkmark-label {
color: @colortheme_checkmark-disabled;
}
2018-04-16 17:07:54 +00:00
}
}
&:hover .cp-radio-mark {
background-color: @colortheme_checkmark-back0-active;
}
input {
display: none;
&:checked ~ .cp-radio-mark {
background-color: @colortheme_checkmark-back1;
border-color: @colortheme_checkmark-back1;
2018-04-16 17:07:54 +00:00
&:after {
display: block;
}
}
&:disabled ~ .cp-checkmark-mark {
background-color: @colortheme_checkmark-disabled;
}
&:disabled ~ .cp-checkmark-label {
color: @colortheme_checkmark-disabled;
}
2018-04-16 17:07:54 +00:00
}
2018-04-18 12:19:45 +00:00
.cp-checkmark-label {
2018-04-19 09:14:22 +00:00
cursor: default;
2018-04-18 12:19:45 +00:00
&:empty {
display: none;
}
}
2018-04-16 17:07:54 +00:00
.cp-radio-mark {
margin-right: 10px;
position: relative;
height: @checkmark-radio-size;
2018-07-14 13:15:23 +00:00
height: var(--checkmark-radio-size);
width: @checkmark-radio-size;
2018-07-14 13:15:23 +00:00
width: var(--checkmark-radio-size);
2018-04-16 17:07:54 +00:00
background-color: @colortheme_checkmark-back0;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid @colortheme_form-border;
flex-shrink: 0;
&:after {
display: none;
content: "";
border-radius: 50%;
background: white;
width: @checkmark-dim1;
2018-07-14 13:15:23 +00:00
width: var(--checkmark-dim1);
height: @checkmark-dim1;
2018-07-14 13:15:23 +00:00
height: var(--checkmark-dim1);
2018-04-16 17:07:54 +00:00
//transform: rotate(45deg);
//border: solid @colortheme_checkmark-col1;
2018-07-14 13:15:23 +00:00
//border-width: 0 var(--checkmark-width) var(--checkmark-width) 0;
2018-04-16 17:07:54 +00:00
}
&:focus {
//border-color: #FF007C !important;
box-shadow: 0px 0px 5px @colortheme_checkmark-back1;
outline: none;
}
2018-04-16 17:07:54 +00:00
}
}
2018-03-13 10:31:08 +00:00
}