Skip to content

Commit 9e73b84

Browse files
Style radio buttons to match custom checkbox styling
1 parent 15a758c commit 9e73b84

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

courses/static/courses.css

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,46 @@ input[type="checkbox"]:disabled {
269269
opacity: 0.65;
270270
}
271271

272+
input[type="radio"] {
273+
appearance: none;
274+
background: var(--input-bg);
275+
border: 1px solid var(--input-border);
276+
border-radius: 50%;
277+
box-sizing: border-box;
278+
cursor: pointer;
279+
height: 1.1rem;
280+
position: relative;
281+
vertical-align: middle;
282+
width: 1.1rem;
283+
}
284+
285+
input[type="radio"]:checked {
286+
background-color: var(--link-color);
287+
border-color: var(--link-color);
288+
}
289+
290+
input[type="radio"]:checked::after {
291+
background: #fff;
292+
border-radius: 50%;
293+
content: "";
294+
height: 0.45rem;
295+
left: 50%;
296+
position: absolute;
297+
top: 50%;
298+
transform: translate(-50%, -50%);
299+
width: 0.45rem;
300+
}
301+
302+
input[type="radio"]:focus-visible {
303+
outline: 2px solid var(--focus-ring);
304+
outline-offset: 2px;
305+
}
306+
307+
input[type="radio"]:disabled {
308+
cursor: not-allowed;
309+
opacity: 0.65;
310+
}
311+
272312
.checkbox-row input[type="checkbox"] {
273313
margin: 0.15rem 0 0;
274314
}

0 commit comments

Comments
 (0)