mdb-ui-kit/sass/_checkboxes.scss

273 lines
5.7 KiB
SCSS
Raw Permalink Normal View History

// This file has been autogenerated by grunt task lessToSass. Any changes will be overwritten.
// http://www.google.com/design/spec/components/selection-controls.html#selection-controls-checkbox
2015-11-18 23:53:05 +03:00
2016-04-26 17:39:58 +03:00
.checkbox label,
label.checkbox-inline {
cursor: pointer;
padding-left: 0; // Reset for Bootstrap rule
color: $mdb-checkbox-label-color;
@include mdb-label-color-toggle-focus();
}
2014-10-03 15:58:24 +04:00
2016-04-26 17:39:58 +03:00
.checkbox,
label.checkbox-inline {
2015-11-22 00:36:03 +03:00
// Hide native checkbox
input[type=checkbox] {
opacity: 0;
position: absolute;
margin: 0;
z-index: -1;
width: 0;
height: 0;
overflow: hidden;
left: 0;
pointer-events: none;
2015-11-18 23:53:05 +03:00
}
2015-11-22 00:36:03 +03:00
.checkbox-material {
vertical-align: middle;
position: relative;
top: 3px;
2016-05-09 18:37:53 +03:00
&:before { // FIXME: document why this is necessary (doesn't seem to be on chrome)
2015-11-22 00:36:03 +03:00
display: block;
2015-11-18 23:53:05 +03:00
position: absolute;
2016-05-09 18:37:53 +03:00
top:-5px;
2015-11-18 23:53:05 +03:00
left: 0;
2015-11-22 00:36:03 +03:00
content: "";
2016-05-09 18:37:53 +03:00
background-color: rgba(0, 0, 0, .84);
2015-11-22 00:36:03 +03:00
height: $mdb-checkbox-size;
width: $mdb-checkbox-size;
border-radius: 100%;
z-index: 1;
opacity: 0;
margin: 0;
transform: scale3d(2.3, 2.3, 1);
2014-10-03 15:58:24 +04:00
}
2015-11-22 00:36:03 +03:00
.check {
position: relative;
2015-11-22 00:36:03 +03:00
display: inline-block;
width: $mdb-checkbox-size;
height: $mdb-checkbox-size;
2016-02-29 18:29:25 +03:00
border: $mdb-checkbox-border-size solid $mdb-checkbox-border-color;
border-radius: $border-radius-base;
2015-11-22 00:36:03 +03:00
overflow: hidden;
z-index: 1;
2015-11-18 23:53:05 +03:00
}
2015-11-22 00:36:03 +03:00
.check:before {
position: absolute;
content: "";
transform: rotate(45deg);
display: block;
margin-top: -4px;
margin-left: 6px;
width: 0;
height: 0;
box-shadow:
2015-11-22 00:36:03 +03:00
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0 inset;
}
2015-11-22 00:36:03 +03:00
}
2014-10-03 15:58:24 +04:00
input[type=checkbox] {
2014-10-03 15:58:24 +04:00
&:focus + .checkbox-material .check:after {
opacity: 0.2;
}
2016-05-09 18:37:53 +03:00
&:focus{
&:checked{
& + .checkbox-material:before {
animation: rippleOn 500ms;
}
& + .checkbox-material .check:before {
animation: checkbox-on $mdb-checkbox-animation-check forwards;
}
& + .checkbox-material .check:after {
animation: rippleOn $mdb-checkbox-animation-ripple forwards; // Ripple effect on check
}
}
&:not(:checked) {
& + .checkbox-material:before {
animation: rippleOff 500ms;
}
& + .checkbox-material .check:before {
animation: checkbox-off $mdb-checkbox-animation-check forwards;
}
& + .checkbox-material .check:after {
animation: rippleOff $mdb-checkbox-animation-ripple forwards; // Ripple effect on uncheck
}
}
}
&:checked {
// FIXME: once working - combine further to reduce code
& + .checkbox-material .check {
color: $mdb-checkbox-checked-color;
border-color: $mdb-checkbox-checked-color;
}
& + .checkbox-material .check:before {
color: $mdb-checkbox-checked-color;
2016-05-09 18:37:53 +03:00
box-shadow:
0 0 0 10px,
10px -10px 0 10px,
2016-05-09 18:37:53 +03:00
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
20px -12px 0 11px;
}
& + .checkbox-material .check:after {
//background-color: $brand-success; // FIXME: seems like tho wrong color, test and make sure it can be removed
}
}
2015-11-22 00:36:03 +03:00
}
2014-10-03 15:58:24 +04:00
2015-11-22 00:36:03 +03:00
// Style for disabled inputs
fieldset[disabled] &,
fieldset[disabled] & input[type=checkbox],
input[type=checkbox][disabled]:not(:checked) ~ .checkbox-material .check:before,
input[type=checkbox][disabled]:not(:checked) ~ .checkbox-material .check,
input[type=checkbox][disabled] + .circle {
opacity: 0.5;
}
2015-11-22 00:36:03 +03:00
input[type=checkbox][disabled] + .checkbox-material .check:after {
background-color: $mdb-text-color-primary;
2015-11-22 00:36:03 +03:00
transform: rotate(-45deg);
}
2014-10-03 15:58:24 +04:00
}
@keyframes checkbox-on {
0% {
box-shadow:
0 0 0 10px,
10px -10px 0 10px,
2015-11-25 02:40:52 +03:00
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
15px 2px 0 11px;
}
50% {
box-shadow:
0 0 0 10px,
10px -10px 0 10px,
2015-11-25 02:40:52 +03:00
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
20px 2px 0 11px;
}
100% {
box-shadow:
0 0 0 10px,
10px -10px 0 10px,
2015-11-25 02:40:52 +03:00
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
20px -12px 0 11px;
}
2014-10-03 15:58:24 +04:00
}
@keyframes checkbox-off {
0% {
box-shadow:
0 0 0 10px,
10px -10px 0 10px,
2015-11-25 02:40:52 +03:00
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
20px -12px 0 11px,
0 0 0 0 inset;
}
25% {
box-shadow:
0 0 0 10px,
10px -10px 0 10px,
2015-11-25 02:40:52 +03:00
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
20px -12px 0 11px,
0 0 0 0 inset;
}
50% {
transform: rotate(45deg);
margin-top: -4px;
margin-left: 6px;
2015-11-25 02:40:52 +03:00
width: 0;
height: 0;
box-shadow:
0 0 0 10px,
10px -10px 0 10px,
2015-11-25 02:40:52 +03:00
32px 0 0 20px,
0px 32px 0 20px,
-5px 5px 0 10px,
15px 2px 0 11px,
0 0 0 0 inset;
}
51% {
transform: rotate(0deg);
margin-top: -2px;
margin-left: -2px;
width: 20px;
height: 20px;
box-shadow:
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
2015-11-25 02:40:52 +03:00
0px 0 0 10px inset;
}
100% {
transform: rotate(0deg);
margin-top: -2px;
margin-left: -2px;
width: 20px;
height: 20px;
box-shadow:
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
0 0 0 0,
2015-11-25 02:40:52 +03:00
0px 0 0 0 inset;
}
}
2014-10-03 15:58:24 +04:00
@keyframes rippleOn {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
2014-10-03 15:58:24 +04:00
}
2014-10-03 15:58:24 +04:00
@keyframes rippleOff {
0% {
opacity: 0;
}
50% {
opacity: 0.2;
}
100% {
opacity: 0;
}
2014-10-03 15:58:24 +04:00
}