Jump to content

Is it possible to change the style of radio buttons & check boxes?

Recommended Posts

Posted

Hi @tuanphan, I'm looking to change the color and size to fit in more with the rest of the site so the dot on the boxes is orange, the circle around is white. The same for drop downs too really, just so they fit in a bit better.

Thanks for the help.

  • 3 weeks later...
Posted

following...

My little bit of research into this seems to be that you need to hide the original checkbox and create a new pseudo element. Then you need to bind the click to it but I haven't gotten it to work.

  Did I help you? Buy me a coffee!

👨‍💻 Bergen Design Co.

💻  I'm for hire on Upwork!

🕸️ Squarespace Experts  

🖥️ 99Designs

 🛠️ Web Designer's Toolkit

**some of these contain affiliate links

Posted

Thanks @tuanphan but my client decided to lose the checkbox altogether! That would be a great resource to share here though. It has come up for me before since every browser has it's own different look.

  Did I help you? Buy me a coffee!

👨‍💻 Bergen Design Co.

💻  I'm for hire on Upwork!

🕸️ Squarespace Experts  

🖥️ 99Designs

 🛠️ Web Designer's Toolkit

**some of these contain affiliate links

Posted

@jaeveedee, @tuanphan - I've managed to alter the check box & radio box elements (see below) - it's a little more work to change the drop down selection menus and I haven't had any success with those yet. Any input would be great…

/* Radio Buttons */
input[type="radio"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.option input[type="radio"]:active {
  cursor:pointer;
  width:30px;
  height:30px;
  background-color:#0e1021;
  border-radius:50%;
}
/* Selected */
.option input[type="radio"]:checked {
  cursor:pointer;
  width:30px;
  height:30px;
  background-color:#e9530d;
  border-radius:50%;
}

.option input[type="radio"] {
/* un-selected */
  background-clip: content-box;
  border: 4px solid #e9530d;
  border-radius: 50%;
  content: " ";
  cursor:pointer;
  width:30px;
  height:30px;
}

/* check boxes */
input[type="checkbox"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.option input[type="checkbox"]:active {
  cursor:pointer;
  width:30px;
  height:30px;
  background-color:#0e1021;
  border-radius:50%;
}
/* Selected */
.option input[type="checkbox"]:checked {
  cursor:pointer;
  width:30px;
  height:30px;
  background-color:#e9530d;
  border-radius:50%;
}

.option input[type="checkbox"] {
/* un-selected */
  background-clip: content-box;
  border: 4px solid #e9530d;
  border-radius: 50%;
  content: " ";
  cursor:pointer;

  • 1 year later...
  • 8 months later...
Posted (edited)

Hey everyone! Two things:

1) Is there a way to change the colour of the text of the Checkbox and Radio options?

2) Is there a way to change the colour of the active text input in the field?

See below: I've made this red just as an example (so I can see what I'm testing easily). I eventually want to be able to put the form on a dark background.

 

Thank you, thank you!

 

Screen Shot 2022-07-15 at 10.00.34 am.png

Edited by OldLadyStudio
Added more information and questions! :)
Posted
8 hours ago, OldLadyStudio said:

Hey everyone! Two things:

1) Is there a way to change the colour of the text of the Checkbox and Radio options?

2) Is there a way to change the colour of the active text input in the field?

See below: I've made this red just as an example (so I can see what I'm testing easily). I eventually want to be able to put the form on a dark background.

 

Thank you, thank you!

 

Screen Shot 2022-07-15 at 10.00.34 am.png

Can you share page url?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 3 months later...
Posted

Was messing around trying to figure this out too and did this:

For styling checkbox stuff (not the actual check box though):

.form-wrapper .field-list .option {
}

For styling the drop down and text:

.form-wrapper .field-list .field select {
}

 

Not sure if this is good/logical but it worked for me!

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.