#e8e8e8
1.checkbox-wrapper { 2 box-sizing: border-box; 3 --background-color: #fff; 4 --checkbox-height: 25px; 5} 6 7.checkbox-wrapper input[type=checkbox] { 8 display: none; 9} 10 11.checkbox-wrapper .check-box { 12 height: var(--checkbox-height); 13 width: var(--checkbox-height); 14 background-color: transparent; 15 border: calc(var(--checkbox-height) * .1) solid #000; 16 border-radius: 5px; 17 position: relative; 18 display: inline-block; 19 -moz-box-sizing: border-box; 20 -webkit-box-sizing: border-box; 21 box-sizing: border-box; 22 -moz-transition: border-color ease 0.2s; 23 -o-transition: border-color ease 0.2s; 24 -webkit-transition: border-color ease 0.2s; 25 transition: border-color ease 0.2s; 26 cursor: pointer; 27} 28 29.checkbox-wrapper .check-box::before, 30 .checkbox-wrapper .check-box::after { 31 -moz-box-sizing: border-box; 32 -webkit-box-sizing: border-box; 33 box-sizing: border-box; 34 position: absolute; 35 height: 0; 36 width: calc(var(--checkbox-height) * .2); 37 background-color: #4158D0; 38 background-image: linear-gradient(43deg, #4158D0 0%, #C850C0 46%, #FFCC70 100%); 39 display: inline-block; 40 -moz-transform-origin: left top; 41 -ms-transform-origin: left top; 42 -o-transform-origin: left top; 43 -webkit-transform-origin: left top; 44 transform-origin: left top; 45 border-radius: 5px; 46 content: " "; 47 -webkit-transition: opacity ease 0.5; 48 -moz-transition: opacity ease 0.5; 49 transition: opacity ease 0.5; 50} 51 52.checkbox-wrapper .check-box::before { 53 top: calc(var(--checkbox-height) * .72); 54 left: calc(var(--checkbox-height) * .41); 55 box-shadow: 0 0 0 calc(var(--checkbox-height) * .05) var(--background-color); 56 -moz-transform: rotate(-135deg); 57 -ms-transform: rotate(-135deg); 58 -o-transform: rotate(-135deg); 59 -webkit-transform: rotate(-135deg); 60 transform: rotate(-135deg); 61} 62 63.checkbox-wrapper .check-box::after { 64 top: calc(var(--checkbox-height) * .37); 65 left: calc(var(--checkbox-height) * .05); 66 -moz-transform: rotate(-45deg); 67 -ms-transform: rotate(-45deg); 68 -o-transform: rotate(-45deg); 69 -webkit-transform: rotate(-45deg); 70 transform: rotate(-45deg); 71} 72 73.checkbox-wrapper input[type=checkbox]:checked + .check-box, 74 .checkbox-wrapper .check-box.checked { 75 border-color: #5900ff; 76} 77 78.checkbox-wrapper input[type=checkbox]:checked + .check-box::after, 79 .checkbox-wrapper .check-box.checked::after { 80 height: calc(var(--checkbox-height) / 2); 81 -moz-animation: dothabottomcheck-19 0.2s ease 0s forwards; 82 -o-animation: dothabottomcheck-19 0.2s ease 0s forwards; 83 -webkit-animation: dothabottomcheck-19 0.2s ease 0s forwards; 84 animation: dothabottomcheck-19 0.2s ease 0s forwards; 85} 86 87.checkbox-wrapper input[type=checkbox]:checked + .check-box::before, 88 .checkbox-wrapper .check-box.checked::before { 89 height: calc(var(--checkbox-height) * 1.2); 90 -moz-animation: dothatopcheck-19 0.4s ease 0s forwards; 91 -o-animation: dothatopcheck-19 0.4s ease 0s forwards; 92 -webkit-animation: dothatopcheck-19 0.4s ease 0s forwards; 93 animation: dothatopcheck-19 0.4s ease 0s forwards; 94}
429 views
429 views
Comments
MIT License