<label><input type="radio" name="e"> First</label>
<label><input type="radio" name="e"> Second</label>
<label><input type="radio" name="e" disabled> Disabled</label>
input[type=radio] {
--s: 1em; /* control the size */
--c: #009688; /* the active color */
height: var(--s);
aspect-ratio: 1;
border: calc(var(--s)/8) solid var(--_c,#939393);
padding: calc(var(--s)/8);
box-shadow:
calc(var(--_p,calc(-2*var(--s))) + var(--s)/8)
0 0 calc(var(--s)/-4) var(--_c,#0000);
background:
radial-gradient(farthest-side,var(--c) 94%,#0000)
var(--_p,calc(-2*var(--s))) 50%
no-repeat content-box padding-box;
border-radius: 50%;
outline-offset: calc(var(--s)/10);
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
cursor: pointer;
font-size: inherit;
transition: .3s;
}
input[type=radio]:checked {
--_c: var(--c);
--_p: 0px;
}
input[type=radio]:disabled {
background:
linear-gradient(#939393 0 0)
50%/100% 20% no-repeat content-box;
opacity: .5;
cursor: not-allowed;
}
@media print {
input[type=radio] {
-webkit-appearance: auto;
-moz-appearance: auto;
appearance: auto;
background: none;
}
}
label {
display:inline-flex;
align-items:center;
gap:10px;
margin:5px 0;
cursor: pointer;
}
body {
margin:0;
min-height:100vh;
display:grid;
place-content:center;
font-family: system-ui, sans-serif;
font-size: 40px;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.