Skip to content

Instantly share code, notes, and snippets.

@jetsloth
Last active March 1, 2023 22:47
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/8723cf35447eb0f4186d8b4bbbddc84e to your computer and use it in GitHub Desktop.
Save jetsloth/8723cf35447eb0f4186d8b4bbbddc84e to your computer and use it in GitHub Desktop.
Gravity Forms Image Choices - Polaroid Style 1
.image-choices-field {
max-width: 100%;
margin-right: -3%;
}
.image-choices-field .image-choices-choice,
.gform_wrapper .gfield.image-choices-field li.image-choices-choice {
display: inline-block;
position: relative;
padding: 13px !important;
overflow: visible;
margin-bottom: 80px !important;
border-color: #d8e3ec;
transition: all 0.3s;
border-radius: 3px;
}
.image-choices-field .image-choices-choice,
.image-choices-field .image-choices-choice.image-choices-choice-hover {
background-color: #f6fbfd;
}
.image-choices-field .image-choices-choice:after {
content: "\2714" !important;
width: 40px;
height: 40px;
overflow: hidden;
border-radius: 50%;
pointer-events: none;
opacity: 0;
transition: all .3s;
text-align: center;
line-height: 40px;
color: #fff;
display: block;
position: absolute;
left: 50%;
top: 60%;
margin: -20px 0 0 -20px;
background-color: #00a7f7;
}
.image-choices-field .image-choices-choice.image-choices-choice-other:after {
top: 70%;
}
.image-choices-field .gfield_label {
font-size: 1.6em;
margin-bottom: 1.6em;
display: block;
}
.image-choices-field .image-choices-choice label,
.gform_wrapper .gfield.image-choices-field li.image-choices-choice label {
padding: 0 !important;
display: block;
}
.image-choices-field .image-choices-choice.image-choices-choice-focus label {
border-color: #00a7f7;
}
.image-choices-field .gfield_radio .image-choices-choice.image-choices-choice-focus.image-choices-choice-selected label {
border-color: transparent;
}
.image-choices-field .image-choices-choice-image-wrap {
background-size: cover;
width: 100%;
height: auto;
padding-bottom: 100%;
}
.image-choices-field.image-choices-show-labels .image-choices-choice-text {
padding: 7px 13px;
margin: 0;
position: absolute;
width: 100%;
left: 50%;
transform: translateX(-50%);
border-radius: 20px;
bottom: -50px;
transition: all 0.3s;
}
.image-choices-field.image-choices-show-labels .image-choices-choice-text,
.image-choices-field.image-choices-show-labels .image-choices-choice-price {
font-size: inherit;
}
.image-choices-field .image-choices-choice.image-choices-choice-selected,
.image-choices-field .image-choices-choice.image-choices-choice-selected.image-choices-choice-hover {
box-shadow: 0 0 30px 0 rgba(0, 0, 0, 0.2);
border-color: #00a7f7;
background-color: #fff;
}
.image-choices-field .image-choices-choice.image-choices-choice-selected:after {
color: #fff;
opacity: 1;
top: 50%;
}
.image-choices-field .image-choices-choice.image-choices-choice-other.image-choices-choice-selected:after {
top: 60%;
}
.image-choices-field .image-choices-choice.image-choices-choice-selected .image-choices-choice-text {
background-color: #00a7f7;
color: #fff;
}
.gform-theme--framework .gfield--type-choice.image-choices-field .gfield_checkbox > :last-child:where(:not(.gchoice)),
.gform-theme--framework .gfield--type-choice.image-choices-field .gfield_radio > :last-child:where(:not(.gchoice)) {
margin-top: var(--gform-theme-field-choice-spacing);
position: relative;
}
.gform_wrapper:not(.gform-theme--foundation) .gfield.image-choices-field:not([class*="gf_list_"]) .image-choices-choice {
width: 30%;
margin-right: 3% !important;
}
.gform-theme--framework .gfield.image-choices-field:not([class*="gf_list_"]) .image-choices-choice {
width: calc(33% - 10px);
}
.gform-theme--framework .gfield--type-choice.image-choices-field:not([class*="gf_list_"]) .gfield_checkbox > :last-child:where(:not(.gchoice)),
.gform-theme--framework .gfield--type-choice.image-choices-field:not([class*="gf_list_"]) .gfield_radio > :last-child:where(:not(.gchoice)) {
width: calc(33% - 10px);
}
@media only screen and (max-width: 736px) {
.gform_wrapper:not(.gform-theme--foundation) .gfield.image-choices-field:not([class*="gf_list_"]) .image-choices-choice {
width: 48%;
margin-right: 2% !important;
}
}
@media only screen and (max-width: 480px) {
.gform_wrapper:not(.gform-theme--foundation) .gfield.image-choices-field:not([class*="gf_list_"]) .image-choices-choice {
width: 98%;
margin-right: 2% !important;
}
}
/*
Find out more at
https://jetsloth.com/gravity-forms-image-choices/
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment