#c9c9c9
1.toggle-wrapper { 2 display: flex; 3 justify-content: center; 4 align-items: center; 5 position: relative; 6 border-radius: 50px; 7 padding: 10px; 8 background-image: linear-gradient(to bottom, #f0f0f0, #e8e8e8); 9 box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); 10 font-size: 1.5em; 11} 12 13.toggle-checkbox { 14 appearance: none; 15 position: absolute; 16 z-index: 1; 17 border-radius: inherit; 18 width: 100%; 19 height: 100%; 20 font: inherit; 21 opacity: 0; 22 cursor: pointer; 23} 24 25.toggle-container { 26 display: flex; 27 align-items: center; 28 position: relative; 29 border-radius: 50px; 30 width: 80px; 31 height: 40px; 32 background-color: #e8e8e8; 33 box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.1); 34 transition: background-color 0.4s linear; 35} 36 37.toggle-checkbox:checked + .toggle-container { 38 background-color: #f3b519; 39} 40 41.toggle-button { 42 display: flex; 43 justify-content: center; 44 align-items: center; 45 position: absolute; 46 left: 2px; 47 border-radius: 50%; 48 width: 36px; 49 height: 36px; 50 background-color: #e8e8e8; 51 box-shadow: inset 0 -2px 2px rgba(0, 0, 0, 0.1), inset 0 -4px 2px rgba(0, 0, 0, 0.2), inset 0 6px 2px rgba(255, 255, 255, 0.3), 0 4px 4px rgba(0, 0, 0, 0.5); 52 transition: left 0.4s; 53} 54 55.toggle-checkbox:checked + .toggle-container > .toggle-button { 56 left: 42px; 57} 58 59.toggle-button-circles-container { 60 display: grid; 61 grid-template-columns: repeat(3, 4px); 62 gap: 2px; 63 position: absolute; 64 margin: 0 auto; 65} 66 67.toggle-button-circle { 68 border-radius: 50%; 69 width: 2px; 70 height: 2px; 71 background-image: radial-gradient(circle at 50% 0, #f5f5f5, #c4c4c4); 72}
Comments
MIT License