1/* The switch - the box around the slider */2.switch{3display: block;4--width-of-switch: 3.5em;5--height-of-switch: 2em;6/* size of sliding icon -- sun and moon */7--size-of-icon: 1.4em;8/* it is like a inline-padding of switch */9--slider-offset: 0.3em;10position: relative;11width:var(--width-of-switch);12height:var(--height-of-switch);13}1415/* Hide default HTML checkbox */16.switch input{17opacity: 0;18width: 0;19height: 0;20}2122/* The slider */23.slider{24position: absolute;25cursor: pointer;26top: 0;27left: 0;28right: 0;29bottom: 0;30background-color: #f4f4f5;31transition: .4s;32border-radius: 30px;33}3435.slider:before{36position: absolute;37content:"";38height:var(--size-of-icon,1.4em);39width:var(--size-of-icon,1.4em);40border-radius: 20px;41left:var(--slider-offset,0.3em);42top: 50%;43transform:translateY(-50%);44background:linear-gradient(40deg,#ff0080,#ff8c00 70%);45;46transition: .4s;47}4849input:checked + .slider{50background-color: #303136;51}5253input:checked + .slider:before{54left:calc(100% - (var(--size-of-icon,1.4em) + var(--slider-offset,0.3em)));55background: #303136;56/* change the value of second inset in box-shadow to change the angle and direction of the moon */57box-shadow: inset -3px -2px 5px -2px #8983f7, inset -10px -4px 0 0 #a3dafb;58}