[FEAT] Add optional light mode#3505
Open
matt-cossins wants to merge 3 commits into
Open
Conversation
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Before submitting a pull request for a new Learning Path, please review Create a Learning Path
Please do not include any confidential information in your contribution. This includes confidential microarchitecture details and unannounced product information.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the Creative Commons Attribution 4.0 International License.
@zachlasiuk @pareenaverma
Appreciate there may be more complexities / other factors to consider - so might not be so simple, but I've taken a stab over lunch at drafting an optional light-mode aligned with the new branding changes, and it came together pretty quickly. Please let me know if this could be workable.
Summary
Add an optional light mode to Arm Learning Paths using the new purple theme.
Dark mode remains the default. Readers can select light mode using an accessible theme toggle, and the browser remembers that preference across Learning Path pages and future visits.
Visual changes
Light mode adds appropriate styling for:
The implementation uses the existing refreshed accent tokens:
#6023DE#D1BAFCAdditional refinements include:
FEATUREDlabel on light-mode (for visibility)Theme behavior
The selection order is:
The operating-system color preference is not used.
The preference is stored in the browser and does not depend on an Arm account or authentication.
Implementation
Theme behavior is owned by a single
theme-preference.jscontroller.The controller:
learn-theme-changeeventTheme manipulation has been removed from the authentication and general preference scripts.
The toggle is hidden when JavaScript is unavailable, leaving the site in its default dark mode without presenting an inactive control.
Tests
Run:
node --test tools/tests/theme-preference.test.mjsThe seven tests cover:
Light mode:

Dark mode:

Dark code blocks remain for both:
