<div class="site-container">
<input type="checkbox" class="neumorphic-switch" />
</div>
@import "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css";
body {
background-color: #ececec;
margin: 0;
}
.site-container {
display: grid;
place-items: center;
min-height: 100vh;
}
.neumorphic-switch {
display: flex;
align-items: center;
justify-content: center;
height: 200px;
width: 200px;
border-radius: 50%;
box-shadow:
-10px -10px 15px rgba(255, 255, 255, 0.5),
10px 10px 15px rgba(70, 70, 70, 0.12);
border: 20px solid #ececec;
outline: none;
cursor: pointer;
-webkit-appearance: none;
}
.neumorphic-switch::after {
font-family: FontAwesome;
content: "\f011";
color: #7a7a7a;
font-size: 70px;
}
.neumorphic-switch:checked{
box-shadow:
-10px -10px 15px rgba(255, 255, 255, 0.5),
10px 10px 15px rgba(70, 70, 70, 0.12),
inset -10px -10px 15px rgba(255, 255, 255, 0.5),
inset 10px 10px 15px rgba(70, 70, 70, 0.12);
}
.neumorphic-switch:checked::after{
color: #15e38a;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.