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

Fix color types #4602

Merged
merged 3 commits into from
Jun 28, 2022
Merged

Fix color types #4602

merged 3 commits into from
Jun 28, 2022

Conversation

Cal-L
Copy link
Contributor

@Cal-L Cal-L commented Jun 28, 2022

Description

#4601

How it looks now
image

Screenshots/Recordings

If applicable, add screenshots and/or recordings to visualize the before and after of your change

Issue

Progresses #???

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

@Cal-L Cal-L requested a review from a team as a code owner June 28, 2022 17:11
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@wachunei
Copy link
Member

wachunei commented Jun 28, 2022

I don't think we should import from nested files , ie: import { ThemeColors } from '@metamask/design-tokens/dist/js/themes/types';

Why not bring Colors type back from the theme utils, and export it from Theme['colors']?
If the export is moved in the @metamask/design-tokens dependency (let's say a file restructure occurred), a lot of instances have to be updated.
Exporting from utils is better abstraction with only one type to keep updated if the dependency changes.

Copy link
Contributor

@jpcloureiro jpcloureiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest on importing { Theme } from '../../../../util/theme/models' and use the indexed access type Theme['colors']

This way we keep the @metamask/design-tokens imports only on utils/theme

@wachunei beat me to it 😄

Copy link
Member

@wachunei wachunei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Cal-L Cal-L merged commit 09669f1 into main Jun 28, 2022
@Cal-L Cal-L deleted the fix/4601-fix-color-type branch June 28, 2022 19:45
@github-actions github-actions bot locked and limited conversation to collaborators Jun 28, 2022
@Cal-L Cal-L added the release-5.4.0 PRs for v5.4.0 release label Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-5.4.0 PRs for v5.4.0 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants