Skip to content

Commit

Permalink
[#2685] styling
Browse files Browse the repository at this point in the history
  • Loading branch information
jiromaykin committed Aug 27, 2024
1 parent 33dc9a8 commit 2e9c24b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,32 @@

{# Item component for changing the parent styles, when child is clicked #}

<li class="choice-list__item">
<label class="choice-list__label {% if bold_label %}choice-list__label--large{% endif %}" for="id_{{ name }}_{{ index }}">
<input type="{% if input_type_radio %}radio{% else %}checkbox{% endif %}" class="choice-list__radio" id="id_{{ name }}_{{ index }}" name="{{ name }}" value="{{ choice.0|unlocalize }}" {% if choice.0 in data or checked %}checked="checked"{% endif %}>
<div class="choice-list__content">
{% if bold_label %}<h2 class="choice-list__heading">Kies {{ choice.1 }}</h2>{% endif %}
<p class="choice-list__p">{{ choice.1 }}</p>
<li class="choice-list__item {% if input_type_radio %}{% else %}radiochoice-list-multiple__item{% endif %}">
{% if input_type_radio %}
<label class="choice-list__label {% if bold_label %}choice-list__label--large{% endif %}" for="id_{{ name }}_{{ index }}">
<input type="{% if input_type_radio %}radio{% else %}checkbox{% endif %}" class="choice-list__radio" id="id_{{ name }}_{{ index }}" name="{{ name }}" value="{{ choice.0|unlocalize }}" {% if choice.0 in data or checked %}checked="checked"{% endif %}>
<div class="choice-list__content">
{% if bold_label %}<h2 class="choice-list__heading">Kies {{ choice.1 }}</h2>{% endif %}
<p class="choice-list__p">{{ choice.1 }}</p>
</div>
{% if icon_symbol %}
{% icon icon_symbol outlined=True extra_classes="icon--large" %}
{% endif %}
</label>

{% else %}
<div class="choice-list-multiple__content">
<div class="form__control">
<div class="checkbox">
<input type="checkbox" class="checkbox__input" id="id_{{ name }}_{{ index }}" name="{{ name }}" value="{{ choice.0|unlocalize }}" {% if choice.0 in data or checked %}checked="checked"{% endif %}>
<label class="checkbox__label" for="id_{{ name }}_{{ index }}">
{% if icon_symbol %}
{% icon icon_symbol outlined=True extra_classes="icon--large" %}
{% endif %}
<p class="checkbox__p">{{ choice.1 }}</p>
</label>
</div>
</div>
</div>
{% if icon_symbol %}
{% icon icon_symbol outlined=True extra_classes="icon--large" %}
{% endif %}
</label>
{% endif %}
</li>
17 changes: 17 additions & 0 deletions src/open_inwoner/scss/components/Form/ChoiceList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,23 @@
left: auto;
right: var(--spacing-medium);
}

// Rare case: if icons would be added to checkbox list
.checkbox__label {
&:has(.icon--large) {
display: flex;
flex-direction: column;

.checkbox .checkbox__label:before {
position: static;
transform: initial;
}
}
[class*='icons'].icon--large {
position: initial;
transform: initial;
}
}
}

&-multiple__item input[type='checkbox'] {
Expand Down

0 comments on commit 2e9c24b

Please sign in to comment.