Skip to content

Commit

Permalink
BZ-29493-checklistitem
Browse files Browse the repository at this point in the history
- added css to change the color and font weight of selected check list item
- updated click dispatch event to dispatch the checkbox text and select status
  • Loading branch information
anjali.deswal authored and murdore committed Jul 26, 2024
1 parent e0b3e2b commit 01ee955
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/CheckListItem/CheckListItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
if (e.target instanceof HTMLInputElement && typeof e.target.checked === 'boolean') {
checked = e.target.checked;
}
dispatch('click');
dispatch('click', { text, checked });
}
</script>

Expand All @@ -19,7 +19,7 @@
{#if $$slots.checkboxLabel}
<slot name="checkboxLabel" />
{:else}
<span class="text">
<span class="text {checked ? 'checked' : ''}">
<!-- eslint-disable-next-line -->
{@html text}
</span>
Expand All @@ -39,6 +39,11 @@
color: var(--check-list-item-text-color);
}
.text.checked {
color: var(--check-list-item-checked-text-color);
font-weight: var(--check-list-item-checked-font-weight);
}
input.checkbox {
accent-color: var(--checkbox-accent-color, #000);
border: 5px solid red;
Expand Down

0 comments on commit 01ee955

Please sign in to comment.