Skip to content

Commit

Permalink
Merge branch 'improvement/improve-checkbox-opacity' into q/1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bert-e committed Jul 7, 2023
2 parents b5cbef1 + 6e942ac commit 39aff18
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/components/checkbox/Checkbox.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const StyledCheckbox = styled.label<{
disabled?: boolean;
checked?: boolean;
}>`
${(props) => (props.disabled ? 'opacity: 0.5;' : '')}
/* Basic styling */
[type='checkbox'] {
Expand Down Expand Up @@ -120,8 +121,13 @@ const StyledCheckbox = styled.label<{
/* Disabled */
[type='checkbox']:disabled {
opacity: 0.5;
[type='checkbox']:checked:disabled {
cursor: not-allowed;
background-color: ${(props) => getTheme(props).selectedActive};
}
[type='checkbox']:not(:checked):disabled {
cursor: not-allowed;
background-color: ${(props) => getTheme(props).textSecondary};
}
`;

0 comments on commit 39aff18

Please sign in to comment.