Skip to content

Commit

Permalink
✨ [#483] add description to selectboxes and radio option
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkiysendoorn1 committed Mar 18, 2024
1 parent c73fa85 commit 85e5f1e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/formio/components/Checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
}
}

.utrecht-form-field__label {
.utrecht-form-field__label, .utrecht-form-description--openforms {
background-color: var(--_of-utrecht-form-field-checkbox-background-color);
--_of-checkbox-label-shift: calc(
var(--of-utrecht-form-label-checkbox-padding-block-start) + var(--utrecht-checkbox-size)
Expand All @@ -36,7 +36,7 @@
margin-inline-start: calc(var(--_of-checkbox-label-shift) * -1);
}

.utrecht-form-label--checkbox {
.utrecht-form-label--checkbox, .utrecht-form-field-description.utrecht-form-field__description {
padding-block-end: var(--of-utrecht-form-label-checkbox-padding-block-end);
padding-block-start: var(--of-utrecht-form-label-checkbox-padding-block-start);
padding-inline-end: var(--of-utrecht-form-label-checkbox-padding-inline-end);
Expand All @@ -52,6 +52,12 @@
}
}

.openforms-theme {
.utrecht-custom-checkbox--openforms:not(:checked) {
background-color: var(--utrecht-checkbox-background-color);
}
}

.openforms-theme {
.utrecht-custom-checkbox--openforms:not(:checked) {
background-color: var(--utrecht-checkbox-background-color);
Expand Down
1 change: 1 addition & 0 deletions src/formio/components/Radio.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default {
label:
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.',
value: 'radioC',
description: 'Description optie C'
},
],
},
Expand Down
1 change: 1 addition & 0 deletions src/formio/components/Selectboxes.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export default {
{
label: 'Optie B',
value: 'selectB',
description: 'Description optie B'
},
{
label:
Expand Down
7 changes: 7 additions & 0 deletions src/formio/templates/radio.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,12 @@
checked=true
{% } %}
>
{% if (item.description) { %}
<div class="utrecht-description utrecht-form-description--openforms">
<p class="utrecht-form-field-description utrecht-form-field__description">
{{ item.description }}
</p>
</div>
{% } %}
</div>
{% }) %}
2 changes: 1 addition & 1 deletion src/scss/components/_radio-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
margin-inline-start: var(--of-utrecht-form-label-radio-padding-inline-start);
}

.utrecht-form-label--radio {
.utrecht-form-label--radio, .utrecht-form-field-description.utrecht-form-field__description {
padding-block-end: var(--of-utrecht-form-label-radio-padding-block-end);
padding-block-start: var(--of-utrecht-form-label-radio-padding-block-start);
padding-inline-end: var(--of-utrecht-form-label-radio-padding-inline-end);
Expand Down

0 comments on commit 85e5f1e

Please sign in to comment.