Add switches
This commit is contained in:
46
frontend/src/app/components/checkbox/styles.module.css
Normal file
46
frontend/src/app/components/checkbox/styles.module.css
Normal file
@@ -0,0 +1,46 @@
|
||||
.switch {
|
||||
display: flex;
|
||||
width: 53px;
|
||||
|
||||
height: 33px;
|
||||
align-items: center;
|
||||
background-color: white;
|
||||
cursor: pointer;
|
||||
padding: 0 2px;
|
||||
border-radius: 150px;
|
||||
position: relative;
|
||||
border: 2px solid #6d6d6d;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.check {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* The knob (replaces ::before) */
|
||||
.knob {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
background-color: #6d6d6d;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
transition: all 0.15s ease-in-out;
|
||||
}
|
||||
.knob:hover {
|
||||
box-shadow: 0 0 0px 5px #33333327;
|
||||
background-color: #333;
|
||||
}
|
||||
|
||||
.check:checked + .switch .knob {
|
||||
transform: translateX(75%);
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
/* Optional background change */
|
||||
.check:checked + .switch {
|
||||
background-color: #8187ff;
|
||||
border: 2px solid #8187ff;
|
||||
}
|
||||
Reference in New Issue
Block a user