Skip to content

Commit

Permalink
fix(look&feel): description spacing in CheckboxSelect
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumeduhr authored and JLou committed Jan 15, 2025
1 parent ee8e905 commit 9fb017f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
6 changes: 6 additions & 0 deletions client/look-and-feel/css/src/Form/Checkbox/Checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
gap: 1rem;
}

&__label-container {
display: flex;
flex-direction: column;
row-gap: calc(4 / var(--font-size-base) * 1rem);
}

&__label {
font-size: common.rem(18);
font-weight: 600;
Expand Down
4 changes: 1 addition & 3 deletions client/look-and-feel/css/src/Form/Radio/Radio.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
}

&__label-container {
--row-gap: calc(4 / var(--font-size-base) * 1rem);

display: flex;
flex-direction: column;
row-gap: var(--row-gap);
row-gap: calc(4 / var(--font-size-base) * 1rem);
}

&__label {
Expand Down
20 changes: 11 additions & 9 deletions client/look-and-feel/react/src/Form/Checkbox/CheckboxSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ export const CheckboxSelect = ({
const optionId = useId();
return (
<div className="af-checkbox__container">
{labelGroup && (
<span className="af-checkbox__label" id={optionId}>
{labelGroup}
{isRequired && <span aria-hidden="true">&nbsp;*</span>}
</span>
)}
{descriptionGroup && (
<span className="af-checkbox__description">{descriptionGroup}</span>
)}
<div className="af-checkbox__label-container">
{labelGroup && (
<span className="af-checkbox__label" id={optionId}>
{labelGroup}
{isRequired && <span aria-hidden="true">&nbsp;*</span>}
</span>
)}
{descriptionGroup && (
<span className="af-checkbox__description">{descriptionGroup}</span>
)}
</div>
<div
role="group"
className={`af-checkbox af-checkbox-select af-checkbox-select--${type}`}
Expand Down

0 comments on commit 9fb017f

Please sign in to comment.