Skip to content

Commit

Permalink
Merge pull request #7099 from Sage/FE-7009-switch-dark-hint-text
Browse files Browse the repository at this point in the history
fix(switch): fixes the invalid design token when using hint text on dark backgrounds
  • Loading branch information
damienrobson-sage authored Nov 29, 2024
2 parents ccac77c + 7b6df7a commit 46a311e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/components/switch/switch.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -387,3 +387,20 @@ export const NewValidationInlineWithDarkModeAndError: Story = () => {
};
NewValidationInlineWithDarkModeAndError.storyName =
"New Validation - Inline with dark background support and error";

export const NewValidationInlineWithDarkModeAndHint: Story = () => {
return (
<Box m={2} padding={3} backgroundColor="#000000">
<CarbonProvider validationRedesignOptIn>
<Switch
label="Example switch (error state)"
labelInline
isDarkBackground
labelHelp="Hint text to show on the Switch"
/>
</CarbonProvider>
</Box>
);
};
NewValidationInlineWithDarkModeAndHint.storyName =
"New Validation - Inline with dark background support and hint text";
2 changes: 1 addition & 1 deletion src/components/switch/switch.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const StyledHintText = styled.div<StyledHintTextProps>`
max-width: 160px;
${({ isDarkBackground }) => css`
color: ${isDarkBackground
? "var(--colorsUtilityYang065)"
? "var(--colorsUtilityYang080)"
: "var(--colorsUtilityYin055)"};
`}
`;
Expand Down

0 comments on commit 46a311e

Please sign in to comment.