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

Add support for dark mode user toggle in Twenty Twenty-One #6783

Closed
westonruter opened this issue Dec 9, 2021 · 1 comment · Fixed by #6874
Closed

Add support for dark mode user toggle in Twenty Twenty-One #6783

westonruter opened this issue Dec 9, 2021 · 1 comment · Fixed by #6874
Labels
Changelogged Whether the issue/PR has been added to release notes. Enhancement New feature or improvement of an existing one Integration: WP Core P2 Low priority
Milestone

Comments

@westonruter
Copy link
Member

Feature Description

When AMP compatibility was added to Twenty Twenty-One (#5648), the dark mode toggle button had to be hidden on AMP pages since there was no way to persist the state:

Currently, dark mode support is only available to users if their system supports it. The theme toggle that is shown which allows the user to switch between light and dark mode has been removed from the frontend, due to the inability to persist the theme preference and being able to unserialize that into the AMP state without explicit user interaction. This issue is being tracked in ampproject/amphtml#20951.

However, as of ampproject/amphtml#36958 there is now an AMP.toggleTheme() action which can be used to toggle dark mode via user preference. So this can be utilized to add that toggle on AMP pages.

Acceptance Criteria

No response

Implementation Brief

No response

QA Testing Instructions

No response

Demo

No response

Changelog Entry

No response

@westonruter westonruter added Enhancement New feature or improvement of an existing one Integration: WP Core labels Dec 9, 2021
@westonruter westonruter added this to the v2.3 milestone Dec 9, 2021
@westonruter westonruter added the P2 Low priority label Dec 23, 2021
@maitreyie-chavan maitreyie-chavan modified the milestones: v2.3, v2.2.2 Feb 8, 2022
@pooja-muchandikar
Copy link

QA Passed ✅

But note that this comment #6874 (review) is yet to be resolved. There is still a minor difference between AMP and non-AMP pages which is the toggle button is not hidden/shown on scroll.

@westonruter westonruter added the Changelogged Whether the issue/PR has been added to release notes. label Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelogged Whether the issue/PR has been added to release notes. Enhancement New feature or improvement of an existing one Integration: WP Core P2 Low priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants