Skip to content

Commit

Permalink
fix(checkbox): added add color prop for checkbox icon
Browse files Browse the repository at this point in the history
  • Loading branch information
cnkeats committed Mar 31, 2022
1 parent a829c3f commit 19a9504
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ export const CheckboxContainer = styled.div`
`;

export const BaseIcon = styled(Icon)`
overflow: visible;
height: 1em;
width: 1em;
${({ color }) => {
return `
overflow: visible;
color: ${color};
width: 1em;
height: 1em;
`;
}}
` as StyledSubcomponentType;

const CheckIcon = styled(BaseIcon)`
Expand Down Expand Up @@ -126,7 +131,6 @@ const NeutralIcon = styled(BaseIcon)`
return `
color: ${color};
path {
stroke: ${color};
stroke-width: 2px;
}
`;
Expand All @@ -148,6 +152,7 @@ export interface CheckboxProps {

checkboxType?: CheckboxTypes;
variant?: variants;
color?: string;
children?: React.ReactNode;
checked?: boolean;
disabled?: boolean;
Expand Down Expand Up @@ -190,6 +195,7 @@ const Checkbox = ({

checkboxType = CheckboxTypes.check,
variant = variants.fill,
color,
checked = false,
children,
disabled = false,
Expand Down Expand Up @@ -233,6 +239,7 @@ const Checkbox = ({
aria-hidden="true"
data-test-id="hsui-Checkbox-Icon"
path={iconPath}
color={color}
variant={variant}
{...iconProps}
/>
Expand Down

0 comments on commit 19a9504

Please sign in to comment.