radh-ui
Version:
Stencil Component Starter
67 lines (65 loc) • 1.21 kB
CSS
:host {
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
color: #0f273d;
font-family: 'Lato', sans-serif;
}
h3 {
font-size: 2.5rem;
font-weight: bold;
}
.swappy-radios label {
display: block;
position: relative;
padding-left: 4rem;
margin-bottom: 1.5rem;
cursor: pointer;
font-size: 2rem;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
color: #555;
}
.swappy-radios label:hover input ~ .radio {
opacity: 0.8;
}
.swappy-radios input {
position: absolute;
opacity: 0;
cursor: pointer;
height: 0;
width: 0;
}
.swappy-radios input:checked ~ span {
color: #ff4646;
transition: color .5s;
}
.swappy-radios input:checked ~ .radio {
background-color: #ff4646;
opacity: 1 ;
}
.swappy-radios input:checked ~ .radio::after {
opacity: 1;
}
.swappy-radios .radio {
position: absolute;
top: 0;
left: 0;
height: 2.5rem;
width: 2.5rem;
background: #c9ded6;
}
.swappy-radios .radio::after {
display: block;
content: '';
position: absolute;
opacity: 0;
top: 0.75rem;
left: 0.75rem;
width: 1rem;
height: 1rem;
background: #fff;
}