Zero Trickery Custom Radios and Checkboxes

I feel like half of all “custom-designed radio buttons and checkboxes” do two things:

  1. Make them bigger
  2. Colorize them

I always think of SurveyMonkey for having big chunky radios and checkboxes. And indeed, just poking at their interface quickly, even …


The post Zero Trickery Custom Radios and Checkboxes appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.


This content originally appeared on CSS-Tricks and was authored by Chris Coyier

I feel like half of all “custom-designed radio buttons and checkboxes” do two things:

  1. Make them bigger
  2. Colorize them

I always think of SurveyMonkey for having big chunky radios and checkboxes. And indeed, just poking at their interface quickly, even internally, the app uses has those all over the place:

SurveyMonkey’s implementation appears to be pseudo-elements on a <label> element with icon fonts and such.

I think it’s worth noting that if that’s all you are doing, you might be able to do that with zero CSS trickery. Just… make them bigger and colorize them.

Like…

input[type="radio"],
input[type="checkbox"] {
  width: 3em;
  height: 3rem;
  accent-color: green;
}

That’ll chunk those suckers up and colorize them pretty good!

Firefox
Chrome

Except (obligatory sad trombone) in Safari:

Safari

We’re so close to having some very simple CSS to accomplish the main use-case for custom checkboxes and radios. But no cigar, that is, unless you can bring yourself to just not care about the Safari UI (it is still perfectly functional, after all).

If you do need to give up and go for a completely custom design, Stephanie Eckles has got you covered:

In related news, I always think of a “toggle” UI control as a set of 2 radio buttons progressively enhanced, but it turns out <button> is the way, as Michelle Barker covers here. No native UI for slider toggle thingies, alas.


The post Zero Trickery Custom Radios and Checkboxes appeared first on CSS-Tricks. You can support CSS-Tricks by being an MVP Supporter.


This content originally appeared on CSS-Tricks and was authored by Chris Coyier


Print Share Comment Cite Upload Translate Updates
APA

Chris Coyier | Sciencx (2021-11-18T00:16:17+00:00) Zero Trickery Custom Radios and Checkboxes. Retrieved from https://www.scien.cx/2021/11/18/zero-trickery-custom-radios-and-checkboxes/

MLA
" » Zero Trickery Custom Radios and Checkboxes." Chris Coyier | Sciencx - Thursday November 18, 2021, https://www.scien.cx/2021/11/18/zero-trickery-custom-radios-and-checkboxes/
HARVARD
Chris Coyier | Sciencx Thursday November 18, 2021 » Zero Trickery Custom Radios and Checkboxes., viewed ,<https://www.scien.cx/2021/11/18/zero-trickery-custom-radios-and-checkboxes/>
VANCOUVER
Chris Coyier | Sciencx - » Zero Trickery Custom Radios and Checkboxes. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/18/zero-trickery-custom-radios-and-checkboxes/
CHICAGO
" » Zero Trickery Custom Radios and Checkboxes." Chris Coyier | Sciencx - Accessed . https://www.scien.cx/2021/11/18/zero-trickery-custom-radios-and-checkboxes/
IEEE
" » Zero Trickery Custom Radios and Checkboxes." Chris Coyier | Sciencx [Online]. Available: https://www.scien.cx/2021/11/18/zero-trickery-custom-radios-and-checkboxes/. [Accessed: ]
rf:citation
» Zero Trickery Custom Radios and Checkboxes | Chris Coyier | Sciencx | https://www.scien.cx/2021/11/18/zero-trickery-custom-radios-and-checkboxes/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.