Skip to content

Commit

Permalink
Use styled span for help text
Browse files Browse the repository at this point in the history
  • Loading branch information
mirka committed Apr 18, 2024
1 parent 8a7f550 commit 8f08d50
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion packages/components/src/checkbox-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ export function CheckboxControl(
__nextHasNoMarginBottom={ __nextHasNoMarginBottom }
label={ heading }
id={ id }
help={ help }
help={
<span className="components-checkbox-control__help">
{ help }
</span>
}
className={ classnames( 'components-checkbox-control', className ) }
>
<HStack spacing={ 0 } justify="start" alignment="top">
Expand Down
9 changes: 5 additions & 4 deletions packages/components/src/checkbox-control/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
@include break-small() {
--checkbox-input-size: 20px;
}

.components-base-control__help {
margin-left: calc(var(--checkbox-input-size) + #{$grid-unit-15});
}
}

.components-checkbox-control__label {
Expand Down Expand Up @@ -85,3 +81,8 @@ svg.components-checkbox-control__indeterminate {
--checkmark-size: calc(var(--checkbox-input-size) + 4px);
}
}

.components-checkbox-control__help {
display: inline-block;
margin-inline-start: calc(var(--checkbox-input-size) + #{$grid-unit-15});
}

0 comments on commit 8f08d50

Please sign in to comment.