Skip to content

Commit

Permalink
refactor(radio button): simplify targeting selected labels
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-sucena committed Dec 6, 2024
1 parent b993c57 commit 0e020cb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lib/components/forms/radio-buttons.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
/>

Check warning on line 14 in src/lib/components/forms/radio-buttons.svelte

View check run for this annotation

Codecov / codecov/patch

src/lib/components/forms/radio-buttons.svelte#L14

Added line #L14 was not covered by tests
<label
class="m-1 justify-self-start rounded-lg bg-taupe-200 px-5 py-1 text-rose-950"

Check warning on line 16 in src/lib/components/forms/radio-buttons.svelte

View check run for this annotation

Codecov / codecov/patch

src/lib/components/forms/radio-buttons.svelte#L16

Added line #L16 was not covered by tests
class:selected={selectedOption === option}
for="radio-{option}"
>

Check warning on line 18 in src/lib/components/forms/radio-buttons.svelte

View check run for this annotation

Codecov / codecov/patch

src/lib/components/forms/radio-buttons.svelte#L18

Added line #L18 was not covered by tests
{option}
Expand All @@ -23,7 +22,7 @@
</fieldset>

<style>
label.selected {
input:checked + label {
background-color: theme('colors.muted-red.400');
color: theme('colors.taupe.100');
}
Expand Down

0 comments on commit 0e020cb

Please sign in to comment.