92 lines
1.5 KiB
SCSS
92 lines
1.5 KiB
SCSS
$checkbox-width: 18px !default;
|
|
$checkbox-height: $checkbox-width !default;
|
|
|
|
md-checkbox {
|
|
display: block;
|
|
margin: 15px;
|
|
white-space: nowrap;
|
|
cursor: pointer;
|
|
outline: none;
|
|
user-select: none;
|
|
|
|
.md-container {
|
|
position: relative;
|
|
top: 4px;
|
|
display: inline-block;
|
|
width: $checkbox-width;
|
|
height: $checkbox-height;
|
|
|
|
&:after {
|
|
content: '';
|
|
position: absolute;
|
|
top: -10px;
|
|
right: -10px;
|
|
bottom: -10px;
|
|
left: -10px;
|
|
}
|
|
|
|
.md-ripple-container {
|
|
position: absolute;
|
|
display: block;
|
|
width: auto;
|
|
height: auto;
|
|
left: -15px;
|
|
top: -15px;
|
|
right: -15px;
|
|
bottom: -15px;
|
|
}
|
|
}
|
|
|
|
// unchecked
|
|
.md-icon {
|
|
transition: 240ms;
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: $checkbox-width;
|
|
height: $checkbox-height;
|
|
border: 2px solid;
|
|
border-radius: 2px;
|
|
}
|
|
|
|
&.md-checked .md-icon {
|
|
border: none;
|
|
}
|
|
|
|
// disabled
|
|
&[disabled] {
|
|
cursor: no-drop;
|
|
}
|
|
|
|
// focus
|
|
&:focus .md-label:not(:empty) {
|
|
border-color: black;
|
|
}
|
|
|
|
|
|
&.md-checked .md-icon:after {
|
|
transform: rotate(45deg);
|
|
position: absolute;
|
|
left: 6px;
|
|
top: 2px;
|
|
display: table;
|
|
width: 6px;
|
|
height: 12px;
|
|
border: 2px solid;
|
|
border-top: 0;
|
|
border-left: 0;
|
|
content: ' ';
|
|
}
|
|
|
|
.md-label {
|
|
border: 1px dotted transparent;
|
|
position: relative;
|
|
display: inline-block;
|
|
margin-left: 10px;
|
|
vertical-align: middle;
|
|
white-space: normal;
|
|
pointer-events: none;
|
|
user-select: text;
|
|
}
|
|
}
|