Skip to content

Commit

Permalink
feat: add styles to checkbox label
Browse files Browse the repository at this point in the history
  • Loading branch information
artursantiago committed Jan 28, 2025
1 parent cab6056 commit ca9bc19
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ const CheckboxField = forwardRef<HTMLDivElement, CheckboxFieldProps>(
{...otherProps}
/>
<div data-fs-checkbox-field-content>
<Label htmlFor={id}>{label}</Label>
<Label data-fs-checkbox-field-label htmlFor={id}>
{label}
</Label>

{shouldDisplayError && (
<span data-fs-checkbox-field-error-message>{error}</span>
Expand Down
13 changes: 13 additions & 0 deletions packages/ui/src/components/molecules/CheckboxField/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
// Default properties
--fs-checkbox-field-gap: var(--fs-spacing-1);

// Label
--fs-checkbox-field-label-color: var(--fs-color-text-light);
--fs-checkbox-field-label-size: var(--fs-text-size-1);
--fs-checkbox-field-label-weight: var(--fs-text-weight-regular);
--fs-checkbox-field-label-line-height: 1.42;

/* Error tokens */
--fs-checkbox-field-error-message-size: var(--fs-text-size-legend);
--fs-checkbox-field-error-message-line-height: 1.1;
Expand All @@ -25,6 +31,13 @@
flex-direction: column;
}

[data-fs-checkbox-field-label] {
color: var(--fs-checkbox-field-label-color);
font-size: var(--fs-checkbox-field-label-size);
font-weight: var(--fs-checkbox-field-label-weight);
line-height: var(--fs-checkbox-field-label-line-height);
}

// --------------------------------------------------------
// Variants Styles
// --------------------------------------------------------
Expand Down

0 comments on commit ca9bc19

Please sign in to comment.