Skip to content

Commit f4d4f47

Browse files
committed
✨ Allows links in checkbox subText
1 parent 18ceefc commit f4d4f47

File tree

4 files changed

+22
-5
lines changed

4 files changed

+22
-5
lines changed

src/components/Checkbox/Checkbox.astro

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,9 @@ const style = color
4343
</span>
4444
)}
4545
</ConditionalWrapper>
46-
{label && subText && <span class="sub-text">{subText}</span>}
46+
{label && subText && (
47+
<span class="sub-text">
48+
<Fragment set:html={subText} />
49+
</span>
50+
)}
4751
</label>

src/components/Checkbox/Checkbox.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
{/if}
4343
</ConditionalWrapper>
4444
{#if label && subText}
45-
<span class="sub-text">{subText}</span>
45+
<span class="sub-text">{@html subText}</span>
4646
{/if}
4747
</label>

src/components/Checkbox/Checkbox.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ const Checkbox = ({
5656
)}
5757
</ConditionalWrapper>
5858
{label && subText && (
59-
<span className="sub-text">{subText}</span>
59+
<span
60+
className="sub-text"
61+
dangerouslySetInnerHTML={{ __html: subText }}
62+
/>
6063
)}
6164
</label>
6265
)

src/components/Checkbox/checkbox.scss

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
display: inline-flex;
66
align-items: center;
77
gap: 10px;
8+
font-size: 16px;
89

910
&.col {
1011
flex-direction: column;
@@ -58,7 +59,7 @@
5859
display: inline-block;
5960
width: 15px;
6061
height: 15px;
61-
border: 1px solid var(--w-checkbox-color);;
62+
border: 1px solid var(--w-checkbox-color);
6263
border-radius: 2px;
6364
position: relative;
6465

@@ -69,7 +70,16 @@
6970

7071
.sub-text {
7172
margin-left: 25px;
72-
font-size: 16px;
73+
font-size: 14px;
7374
color: #BBB;
75+
76+
a {
77+
@include Transition(color);
78+
color: #BBB;
79+
80+
&:hover {
81+
color: #FFF;
82+
}
83+
}
7484
}
7585
}

0 commit comments

Comments
 (0)