Skip to content

chore: upgrading design tokens package that includes dynamic theming#23101

Merged
georgewrmarshall merged 2 commits intodevelopfrom
fix/upgrade-design-tokens
Feb 22, 2024
Merged

chore: upgrading design tokens package that includes dynamic theming#23101
georgewrmarshall merged 2 commits intodevelopfrom
fix/upgrade-design-tokens

Conversation

@georgewrmarshall
Copy link
Copy Markdown
Contributor

@georgewrmarshall georgewrmarshall commented Feb 21, 2024

Description

This PR upgrades the @metamask/design-tokens package to version 2.1.1, which introduces an enhancement for dynamic theming support. With this update, components can now be wrapped in parent containers tagged with data-theme="light" or data-theme="dark" attributes, allowing for seamless theme changes that respect the specified theme at any level of nesting. This improvement addresses the need for more flexible theming options within our application, ensuring that theme consistency is maintained across different UI components regardless of their hierarchical structure.

Related issues

Related: MetaMask/design-tokens#626

Manual testing steps

  1. Pull this branch
  2. Implement a component structure similar to the provided template, with nested Box components having different data-theme attributes.
  3. Verify that each Box component correctly displays its theme according to the data-theme attribute, demonstrating the dynamic theming capability.

Provided template in ui/components/component-library/text/text.stories.tsx

const Template: StoryFn<typeof Text> = (args) => (
  <Box data-theme="dark" padding={4} backgroundColor={BackgroundColor.backgroundDefault}>
    <Text>dark theme</Text>
    <Box data-theme="light" padding={4} backgroundColor={BackgroundColor.backgroundDefault}>
      <Text>light theme</Text>
      <Box data-theme="dark" padding={4} backgroundColor={BackgroundColor.backgroundDefault}>
        <Text>dark theme</Text>
      </Box>
    </Box>
  </Box>
);

Screenshots/Recordings

Before

before1080.mov

After

after1080.mov

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues.
  • I've included manual testing steps.
  • I've included screenshots/recordings if applicable.
  • I’ve included tests if applicable.
  • I’ve documented my code using JSDoc format if applicable.
  • I’ve applied the right labels on the PR.
  • I’ve properly set the pull request status to "ready for review".

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g., pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@georgewrmarshall georgewrmarshall added the team-design-system All issues relating to design system in Extension label Feb 21, 2024
@georgewrmarshall georgewrmarshall self-assigned this Feb 21, 2024
@github-actions
Copy link
Copy Markdown
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.

@georgewrmarshall georgewrmarshall marked this pull request as ready for review February 21, 2024 20:46
@georgewrmarshall georgewrmarshall requested a review from a team as a code owner February 21, 2024 20:46
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [88de57c]
Page Load Metrics (1862 ± 151 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint1492731893316
domContentLoaded188941199
load142226581862314151
domInteractive188941199
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@georgewrmarshall georgewrmarshall merged commit b0660c0 into develop Feb 22, 2024
@georgewrmarshall georgewrmarshall deleted the fix/upgrade-design-tokens branch February 22, 2024 02:50
@github-actions github-actions bot locked and limited conversation to collaborators Feb 22, 2024
@metamaskbot metamaskbot added the release-11.12.0 Issue or pull request that will be included in release 11.12.0 label Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-11.12.0 Issue or pull request that will be included in release 11.12.0 team-design-system All issues relating to design system in Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants