
Solution retrospective
What specific areas of your project would you like help with?
I'm currently working with different input types like radio buttons and checkboxes for the first time, and I'm running into some styling challenges.
I’m not using any image assets — just pure CSS with background-color and outline to style them. It works, but I’m not sure if it's the best or most scalable approach.
input[type="checkbox"] {
appearance: none;
-webkit-appearance: none;
width: 1rem;
height: 1rem;
border: .1rem solid var(--Grey-500-medium);
position: relative;
}
input[type="checkbox"]:checked {
border-color: var(--Green-600-medium);
background-color: var(--Green-600-medium);
}
input[type="checkbox"]:checked::after {
content: '\2713';
color: var(--White);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
How do you usually style custom radios and checkboxes? Do you use icons or stick with CSS-only solutions?
Would love to hear your thoughts or tips on this!
Code
Loading...
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Binh05's solution.
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord