Skip to content

Commit

Permalink
fix(checkbox-skeleton): apply skeleton class to checkbox (carbon-desi…
Browse files Browse the repository at this point in the history
  • Loading branch information
abbeyhrt authored and joshblack committed Jan 14, 2020
1 parent 7315830 commit 4af62e6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions packages/components/src/components/checkbox/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,17 @@
.#{$prefix}--checkbox-label[data-contained-checkbox-state='mixed'][data-contained-checkbox-disabled='true']::before {
background-color: $disabled-02;
}

//-----------------------------------------------
// Skeleton
//-----------------------------------------------

.#{$prefix}--checkbox-label-text.#{$prefix}--skeleton {
@include skeleton;
width: rem(100px);
height: $spacing-05;
margin: auto 0;
}
}

@include exports('checkbox') {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Checkbox/Checkbox-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ describe('CheckboxSkeleton', () => {
});

it('has the expected classes', () => {
expect(label.hasClass(`${prefix}--checkbox-label`)).toEqual(true);
expect(label.hasClass(`${prefix}--checkbox-label-text`)).toEqual(true);
expect(label.hasClass(`${prefix}--skeleton`)).toEqual(true);
});
});
Expand Down
3 changes: 2 additions & 1 deletion packages/react/src/components/Checkbox/Checkbox.Skeleton.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ const CheckboxSkeleton = ({ className, ...rest }) => (
className={cx(
`${prefix}--form-item`,
`${prefix}--checkbox-wrapper`,
`${prefix}--checkbox-label`,
className
)}
{...rest}>
<span className={`${prefix}--checkbox-label ${prefix}--skeleton`} />
<span className={`${prefix}--checkbox-label-text ${prefix}--skeleton`} />
</div>
);

Expand Down

0 comments on commit 4af62e6

Please sign in to comment.