Skip to content

Instantly share code, notes, and snippets.

@jetsloth
Created July 25, 2017 00:24
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 jetsloth/3faefc105d6b2c009e783f665cd07baa to your computer and use it in GitHub Desktop.
Save jetsloth/3faefc105d6b2c009e783f665cd07baa to your computer and use it in GitHub Desktop.
Custom CSS for tiled image choices based on https://www.materialpalette.com/pink/red
.image-choices-field {
padding: 0 !important;
margin: 0 !important;
}
.image-choices-field .image-choices-choice,
.gform_wrapper .gfield.image-choices-field li.image-choices-choice {
margin: 0 !important;
border: none !important;
position: relative;
vertical-align: middle;
width: 20%;
overflow: hidden;
background-color: #374046;
}
.image-choices-field .image-choices-choice-image-wrap {
width: 100%;
height: auto;
padding-bottom: 100%;
background-color: transparent;
background-size: cover;
}
.image-choices-field ul.gfield_checkbox,
.image-choices-field ul.gfield_radio {
width: 100% !important;
margin: 0 !important;
}
.image-choices-field .image-choices-choice label {
display: block !important;
padding: 0 !important;
border: none !important;
position: relative;
color: #fff;
text-align: left;
transition: all 0.2s;
}
.image-choices-field .image-choices-choice label:after {
content: "✓";
display: block;
position: absolute;
bottom: 15px;
right: 18px;
opacity: 0.5;
transition: all 0.2s;
}
.image-choices-field.image-choices-show-labels .image-choices-choice-text {
display: block;
position: absolute;
width: 100%;
top: 0;
left: 0;
padding: 10px;
}
.image-choices-field .image-choices-choice.image-choices-choice-hover label,
.image-choices-field .image-choices-choice.image-choices-choice-selected label {
transform: scale(0.9);
}
.image-choices-field .image-choices-choice.image-choices-choice-selected label:after {
opacity: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment