ldc-legaulois/resources/sass/front/modules/_magic-check.scss
2021-03-11 09:39:10 +01:00

380 lines
8.7 KiB
SCSS
Vendored

/******** Customize Checkbox *********/
@keyframes default-effect {
0% {
opacity : 0;
}
to {
opacity : 1;
}
}
.checkbox-wrap {
display: table;
&:hover {
.magic-checkbox {
+ label {
&:after {
//display: block;
}
}
}
}
.check {
display: table-cell;
position: relative;
vertical-align: text-top;
height: 20px; width: 20px;
&:hover {
.magic-checkbox {
+ label {
&:after {
display: block;
}
}
}
}
}
label {
color: $color5;
cursor: pointer;
font-family: 'Catamaran-Regular';
font-size: 12px;
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
}
> label {
display: table-cell;
vertical-align: middle;
}
&.blue-checkbox {
.magic-checkbox {
&:checked {
+ label {
&:before {
border: $color4;
background: $color4;
}
}
}
}
}
&.dark-checkbox {
.magic-checkbox {
&:checked {
+ label {
&:before {
border: $color5;
background: $color5;
}
}
}
}
}
&.big-checkbox {
.check {
height: 46px;
width: 46px;
&:hover {
+ label {
&:before {
border-color: #fff;
}
}
}
}
.magic-checkbox {
+ label:hover:before { border-color: #fff; }
}
.magic-checkbox, .magic-radio {
+ label {
padding-left: 60px;
&:before {
border-color: #fff;
height: 46px;
width: 46px;
}
&:after {
font-size: 21px;
left: 9px;
top: 12px;
@include min-width($mobile) {
left: 17px;
top: 23px;
}
}
&:hover {
&:before {
border-color: #fff;
}
}
}
}
}
&.checkbox-right {
.check {
padding-left: 15px;
}
.magic-checkbox {
+ label {
padding-left: 0;
}
}
}
&.check-2 {
line-height: 24px;
> label {
line-height: 125%;
text-align: left;
}
.magic-checkbox {
+ label {
line-height: 125%;
&:before {
border-color: #fff;
}
&:after {
color: $orange;
content: "\e903";
font-size: 24px;
left: 3px;
top: -3px;
}
}
&:checked {
+label {
&:before {
background: #fff;
border-color: #fff;
}
&:after {
}
}
}
}
}
&.check-3 {
line-height: 24px;
> label {
line-height: 125%;
}
.magic-checkbox {
+ label {
&:before {
border-color: #e5dace;
}
&:after {
color: $orange;
content: "\e903";
font-size: 24px;
left: 3px;
top: -6px;
}
}
&:checked {
+ label {
&:before {
background: #fff;
border-color: #e5dace;
}
}
}
}
}
&.check-4 {
> label {
line-height: 125%;
}
.magic-checkbox {
+ label {
&:before {
background-color: transparent;
border-color: #fff;
}
&:after {
color: $orange;
content: "\e903";
font-size: 24px;
left: 3px;
top: -3px;
}
}
&:checked {
+label {
&:before {
border-color: #fff;
border-width: 5px;
}
}
}
}
}
}
.dark-bgcolor {
.checkbox-wrap {
label {
color: #fff;
}
}
.magic-checkbox, .magic-radio {
+ label {
&:before {
border-color: #fff;
}
}
}
}
.magic-checkbox, .magic-radio {
position: absolute;
display: none;
+ label {
cursor: pointer;
display: block;
font-family: 'Catamaran-Regular';
padding-left: 30px;
position: relative;
vertical-align: middle;
&:before {
content: '';
display: inline-block;
position: absolute;
left: 0;
top: 0;
height: 20px;
width: 20px;
}
&:after {
content: '';
display: none;
position: absolute;
}
&:hover {
&:after {
animation-duration: .5s;
animation-fill-mode: both;
animation-name: default-effect;
}
}
}
&[disabled] {
cursor: not-allowed;
+ label {
color: #e4e4e4;
cursor: not-allowed;
&:after, &:before, &:hover { cursor: not-allowed; }
&:hover {
&:before {
animation-name: none;
border-color: #e4e4e4;
border-style: solid;
border-width: 1px;
}
}
&:before { border-color: #e4e4e4; }
}
}
&:checked {
+ label {
&:before { animation-name: none; }
}
}
}
.magic-checkbox {
+ label {
font-size: 12px;
&:before {
background-color: #fff;
border-color: #e5dace;
border-radius: 3px;
border-style: solid;
border-width: 2px;
}
&:after {
border-left: 0;
border-top: 0;
box-sizing: border-box;
color: #e5dace;
content: "\e902";
font-family: 'icomoon';
font-size: 9px;
left: 4px;
top: 4px;
}
&:hover {
&:after {
display: block;
}
}
}
&:checked {
&[disabled] {
+ label {
&:before {
background: #c9e2f9;
border-color: #c9e2f9;
}
}
}
+ label {
&:before {
border: $orange;
background: $orange;
}
&:after {
color: #fff;
display: block;
}
}
}
}
.magic-radio {
+ label {
color: $color10;
font-size: 14px;
line-height: 20px;
&:before {
background-color: #fff;
border-radius: 50%;
}
&:after {
background: $orange;
border-radius: 50%;
left: 6px;
top: 6px;
height: 8px;
width: 8px;
}
}
&:checked {
&[disabled] {
+ label {
&:before { border-color: #c9e2f9; }
&:after { background: #c9e2f9; }
}
}
+ label {
&:before {
}
&:after { display: block; }
}
}
&.bordered {
+ label {
color: $color10;
&:before {
border: 1px solid $color10;
}
&:after {}
}
}
&.bordered-2 {
+ label {
color: #e8ded5;
&:before {
border: 1px solid #e8ded5;
}
&:after {}
}
}
}