#212121
1.checkbox-con { 2 margin: 10px; 3 display: flex; 4 align-items: center; 5 color: white; 6} 7 8.checkbox-con input[type="checkbox"] { 9 appearance: none; 10 width: 48px; 11 height: 27px; 12 border: 2px solid #ff0000; 13 border-radius: 20px; 14 background: #f1e1e1; 15 position: relative; 16 box-sizing: border-box; 17} 18 19.checkbox-con input[type="checkbox"]::before { 20 content: ""; 21 width: 14px; 22 height: 14px; 23 background: rgba(234, 7, 7, 0.5); 24 border: 2px solid #ea0707; 25 border-radius: 50%; 26 position: absolute; 27 top: 0; 28 left: 0; 29 transform: translate(13%, 15%); 30 transition: all 0.3s ease-in-out; 31} 32 33.checkbox-con input[type="checkbox"]::after { 34 content: url("data:image/svg+xml,%3Csvg xmlns='://www.w3.org/2000/svg' width='23' height='23' viewBox='0 0 23 23' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M6.55021 5.84315L17.1568 16.4498L16.4497 17.1569L5.84311 6.55026L6.55021 5.84315Z' fill='%23EA0707' fill-opacity='0.89'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M17.1567 6.55021L6.55012 17.1568L5.84302 16.4497L16.4496 5.84311L17.1567 6.55021Z' fill='%23EA0707' fill-opacity='0.89'/%3E%3C/svg%3E"); 35 position: absolute; 36 top: 0; 37 left: 20px; 38} 39 40.checkbox-con input[type="checkbox"]:checked { 41 border: 2px solid #02c202; 42 background: #e2f1e1; 43} 44 45.checkbox-con input[type="checkbox"]:checked::before { 46 background: rgba(2, 194, 2, 0.5); 47 border: 2px solid #02c202; 48 transform: translate(133%, 13%); 49 transition: all 0.3s ease-in-out; 50} 51 52.checkbox-con input[type="checkbox"]:checked::after { 53 content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='13' viewBox='0 0 15 13' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M14.8185 0.114533C15.0314 0.290403 15.0614 0.605559 14.8855 0.818454L5.00187 12.5L0.113036 6.81663C-0.0618274 6.60291 -0.0303263 6.2879 0.183396 6.11304C0.397119 5.93817 0.71213 5.96967 0.886994 6.18339L5.00187 11L14.1145 0.181573C14.2904 -0.0313222 14.6056 -0.0613371 14.8185 0.114533Z' fill='%2302C202' fill-opacity='0.9'/%3E%3C/svg%3E"); 54 position: absolute; 55 top: 5px; 56 left: 5px; 57} 58 59.checkbox-con label { 60 margin-left: 10px; 61 cursor: pointer; 62 user-select: none; 63} 64
5.2K views
5.2K views
Comments
MIT License