Skip to content

Commit

Permalink
refactor: simplify Radios input CSS
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 26, 2020
1 parent 4e468e3 commit 546a39b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
22 changes: 14 additions & 8 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -421,40 +421,46 @@ input.submit_button:focus {
border: 2px solid #727272;
}

.formcreator_radios .form-group-radio {
.formcreator_form div.radio {
padding: 3.7px 0;
}
.formcreator_form div.radio label {
cursor: pointer;
}
.radios .form-group-radio {
position: relative;
display: inline-block;
width: 16px;
height: 16px;
}
.formcreator_radios .form-group-radio + label {
.radios .form-group-radio + label {
margin-left: 7px;
}
.formcreator_radios input[type = radio] {
input[type = radio] {
display: none;
}
.formcreator_radios .radio {
.label-radio .radio {
padding: 2px 0;
}
.formcreator_radios input[type = radio] + label.label-radio span {
input[type = radio] + label.label-radio span {
display: inline-block;
position: absolute;
width: 16px;
height: 16px;
}
.formcreator_radios input[type = radio] + label.label-radio .box {
input[type = radio] + label.label-radio .box {
background-color: #fff;
border: 2px solid #727272;
border-radius: 50%;
}
.formcreator_radios input[type = radio] + label.label-radio .check {
input[type = radio] + label.label-radio .check {
left: 4px;
top: 4px;
width: 0px;
height: 0px;
opacity: 0;
}
.formcreator_radios input[type = radio]:checked + label.label-radio .check {
input[type = radio]:checked + label.label-radio .check {
border: 6px solid #727272;
border-radius: 50%;
transition: opacity 0.3s ease;
Expand Down
2 changes: 1 addition & 1 deletion inc/fields/radiosfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function getRenderedHtml($canEdit = true) {
$html .= '<span class="check"></span>';
$html .= '</label>';
$html .= '</span>';
$html .= '<label class="label-radio" title="' . $value . '" for="' . $domId . '_' . $i . '">';
$html .= '<label for="' . $domId . '_' . $i . '">';
$html .= $value;
$html .= '</label>';
$html .= '</div>';
Expand Down

0 comments on commit 546a39b

Please sign in to comment.