MetaMask/design-tokens

Add documentation on dynamic theming

Opened this issue · 0 comments

Description

With the recent introduction of dynamic theming as a feature in our application, there is a need to create comprehensive documentation around its implementation and usage. This documentation will guide developers on how to effectively utilize dynamic theming to switch between light and dark modes at a component or section level, rather than relying on inverse variables. By wrapping a parent container in a provider(CSSinJS) or tagging it with data-theme="light" or data-theme="dark"(CSS variables), we can ensure that all child components respect the theming, thus preserving accessibility and visual consistency across the application.

Technical Details

  • Scope: The documentation should cover the following key areas:
    • An overview of dynamic theming and its benefits, particularly in terms of accessibility and user experience.
    • Step-by-step instructions on how to implement dynamic theming, including examples of wrapping components in a theme provider and using data-theme attributes.
    • Best practices for designing components and UI sections with dynamic theming in mind, emphasizing the importance of maintaining visual consistency between light and dark modes.
    • Guidelines on testing dynamic theming to ensure it functions correctly across different parts of the application.

Acceptance Criteria

  • Comprehensive documentation on dynamic theming is available and accessible to all developers within the team.
  • The documentation includes clear, actionable instructions on implementing dynamic theming, supported by code examples.
  • Best practices and testing guidelines are outlined to help developers design and verify their implementations effectively.
  • The documentation is reviewed and approved by key stakeholders, ensuring it meets the needs of both developers and designers working on the project.

Additional Information

The addition of dynamic theming documentation is a crucial step towards empowering our team to fully leverage this feature, enhancing the overall user experience of our application. Once completed, this documentation should be integrated into our existing developer documentation portal or repository, making it easily accessible to all team members.