Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add color prop for checkbox icon #374

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,12 @@ export const CheckboxContainer = styled.div`
`;

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

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

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

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