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

feat!: Replace ‘on background’ props with ‘inverseColor’ and ‘contrastColor’ for Link, Link List Link, and Icon Button #1448

Merged
merged 15 commits into from
Jul 26, 2024

Conversation

VincentSmedinga
Copy link
Contributor

Describe the pull request

Thank you for contributing to the project!
Please use this template to help us handle your PR smoothly.

What

This replaces onBackground="light" with contrastColor={true} and onBackground="dark" with inverseColor={true} for Link, Link List Link, and Icon Button. Related tokens and class names are affected.

Why

We had an inconsistency between this onBackground prop and the inverseColor prop of many other components. We’ve analyzed that and found that adding a constrastColor prop allows us to use the inverseColor prop consistently.

Shortly, the ‘contrast color’ is an alternative foreground colour for a text or icon component if they are on a light (not white) background. The ‘inverse color’ is the same for a dark background.

How

This is largely a ‘find and replace’ refactoring.

I chose not to add visited colours to these components, even thought the tokens for it are available in the link-appearance layer.

Checklist

Before submitting your pull request, please ensure you have done the following. Check each checkmark if you have done so or if it wasn't necessary:

  • Add or update unit tests
  • Add or update documentation
  • Add or update stories
  • Add or update exports in index.* files
  • Start the PR title with a Conventional Commit prefix, as explained here.

Additional notes

  • Provide links to any related issues or discussions.
  • Add a link to the specific story in the feature branch deploy.
  • Mention any areas where additional review or feedback is needed.

@VincentSmedinga VincentSmedinga changed the title feat! Replace ‘on background’ props with ‘inverseColor’ and ‘contrastColor’ for Link, Link List Link, and Icon Button feat!: Replace ‘on background’ props with ‘inverseColor’ and ‘contrastColor’ for Link, Link List Link, and Icon Button Jul 22, 2024
@github-actions github-actions bot temporarily deployed to demo-DES-776-1-refactor-on-background-prop July 24, 2024 23:00 Destroyed
packages/react/src/IconButton/IconButton.tsx Outdated Show resolved Hide resolved
storybook/config/preview-body.html Outdated Show resolved Hide resolved
storybook/src/components/IconButton/IconButton.docs.mdx Outdated Show resolved Hide resolved
storybook/src/components/LinkList/LinkList.stories.tsx Outdated Show resolved Hide resolved
storybook/src/components/LinkList/LinkList.stories.tsx Outdated Show resolved Hide resolved
storybook/src/components/LinkList/LinkList.stories.tsx Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to demo-DES-776-1-refactor-on-background-prop July 26, 2024 09:50 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-776-1-refactor-on-background-prop July 26, 2024 11:36 Destroyed
@github-actions github-actions bot temporarily deployed to demo-DES-776-1-refactor-on-background-prop July 26, 2024 11:41 Destroyed
@VincentSmedinga VincentSmedinga requested a review from alimpens July 26, 2024 11:50
@github-actions github-actions bot temporarily deployed to demo-DES-776-1-refactor-on-background-prop July 26, 2024 12:34 Destroyed
@VincentSmedinga VincentSmedinga requested a review from alimpens July 26, 2024 13:29
@github-actions github-actions bot temporarily deployed to demo-DES-776-1-refactor-on-background-prop July 26, 2024 13:29 Destroyed
@VincentSmedinga VincentSmedinga merged commit f5176b1 into develop Jul 26, 2024
6 checks passed
@VincentSmedinga VincentSmedinga deleted the feature/DES-776-1-refactor-on-background-prop branch July 26, 2024 14:22
@github-actions github-actions bot mentioned this pull request Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants