Modified Switch component based on Material Guidelines.

feature/appm-store/pbac
Menaka Jayawardena 7 years ago
parent 97afd6386c
commit 4a065f40c9

@ -20,8 +20,8 @@
.switch { .switch {
position: relative; position: relative;
display: inline-block; display: inline-block;
width: 40px; width: 36px;
height: 24px; height: 14px;
} }
/* Hide default HTML checkbox */ /* Hide default HTML checkbox */
@ -35,7 +35,7 @@
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: #ccc; background-color: #a0a0a0;
-webkit-transition: .4s; -webkit-transition: .4s;
transition: .4s; transition: .4s;
} }
@ -43,17 +43,17 @@
.slider:before { .slider:before {
position: absolute; position: absolute;
content: ""; content: "";
height: 16px; top: -3px;
width: 16px; height: 20px;
left: 4px; width: 20px;
bottom: 4px;
background-color: white; background-color: white;
-webkit-transition: .4s; -webkit-transition: .4s;
transition: .4s; transition: .4s;
box-shadow: rgba(0, 0, 0, 0.117647) 0px 1px 6px, rgba(0, 0, 0, 0.117647) 0px 1px 4px;
} }
input:checked + .slider { input:checked + .slider {
background-color: #2196F3; background-color: rgba(33, 150, 243, 0.51);
} }
input:focus + .slider { input:focus + .slider {
@ -61,9 +61,10 @@ input:focus + .slider {
} }
input:checked + .slider:before { input:checked + .slider:before {
-webkit-transform: translateX(16px); -webkit-transform: translateX(20px);
-ms-transform: translateX(16px); -ms-transform: translateX(20px);
transform: translateX(16px); transform: translateX(20px);
background-color: #2196F3;
} }
/* Rounded sliders */ /* Rounded sliders */

Loading…
Cancel
Save