Skip to content

Instantly share code, notes, and snippets.

@Kennyboy7
Created February 22, 2023 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kennyboy7/326505571104a0b7a77d59416298d5bf to your computer and use it in GitHub Desktop.
Save Kennyboy7/326505571104a0b7a77d59416298d5bf to your computer and use it in GitHub Desktop.
Gravityforms - Green Ticks Checkbox and Radio buttons
/* Re-style Checkboxs and Radio buttons */
.gform_wrapper ul.gfield_checkbox li input[type=checkbox], .gform_wrapper ul.gfield_radio li input[type=radio] {
display: none;
margin: 0;
width: 0!important;
}
.gform_wrapper input[type=checkbox] + label, .gform_wrapper input[type=radio] + label { font-size: 16px; }
input[type=checkbox] + label:hover, input[type=radio] + label:hover { cursor: pointer; }
input[type=checkbox] + label:before, input[type=radio] + label:before {
font-family: FontAwesome;
font-size: 23px;
position: relative;
top: 0.1em;
margin-right: 0.5em;
}
.gform_wrapper li.gf_list_inline ul.gfield_checkbox li, .gform_wrapper li.gf_list_inline ul.gfield_radio li {
display: -moz-inline;
display: inline;
}
body .gform_wrapper .gform_body .gform_fields .gfield .gfield_radio .gchoice {
margin: 15px 15px; /* adjusts the position of the yes / no tick boxes */
}
/* Styles the radio and checkboxes to a green tick from Fontawesome */
input[type=checkbox] + label:before { content: '\f0c8'; color: #ccc; }
input[type=checkbox] + label:hover:before { content: '\f0c8'; color: green;}
input[type=checkbox]:checked + label:before { content: '\f14a'; color: green;}
input[type=checkbox]:checked + label:hover:before { content: '\f14a'; color: green; }
input[type=radio] + label:before { content: '\f0c8';color: #ccc; }
input[type=radio] + label:hover:before { content: '\f0c8'; color: green; }
input[type=radio]:checked + label:before { content: '\f14a'; color: green;}
input[type=radio]:checked + label:hover:before { filter: alpha(opacity=100)}
/* Hide the OS/Browser checkboxes/radio buttons */
input[type=checkbox], input[type=radio] {
visibility: hidden!important;
margin: 0!important;
width: 0!important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment