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

feat(themes): add theme switcher feature #230 #231

Closed
wants to merge 8 commits into from

Conversation

jason-capsule42
Copy link
Member

Alaska Airlines Pull Request

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes: AlaskaAirlines/auro-themeswitcher#1

Summary:

Build out themeswitcher

Type of change:

Please delete options that are not relevant.

  • New capability
  • Revision of an existing capability
  • Infrastructure change (automation, etc.)
  • Other (please elaborate)

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

@jason-capsule42 jason-capsule42 requested a review from a team as a code owner September 22, 2023 17:32
@jason-capsule42 jason-capsule42 self-assigned this Sep 22, 2023
@jason-capsule42 jason-capsule42 marked this pull request as draft September 22, 2023 17:32
@jason-capsule42 jason-capsule42 marked this pull request as ready for review September 22, 2023 17:32
@jason-capsule42 jason-capsule42 force-pushed the jbaker/themeSwitcher branch 3 times, most recently from 91e684d to 867bde4 Compare September 22, 2023 17:41
@github-actions
Copy link

Surge demo deployment failed! 😭

@jason-capsule42 jason-capsule42 force-pushed the jbaker/themeSwitcher branch 2 times, most recently from 3273f72 to 2942e74 Compare September 25, 2023 01:28
},
{
label: 'Auro Dark',
url: 'AURO DARK URL'
Copy link
Member

Choose a reason for hiding this comment

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

Going to darkmode is not a process of switching a URL path to tokens. The darkmode token definitions should be loaded with the light mode defs, only that the darkmode is wrapped in this media query.

@media screen and (prefers-color-scheme: dark) {
    :root {

We also need this to trigger the rest of the browser's native color modes.

@media screen and (prefers-color-scheme: dark) {
    :root {
        color-scheme:dark
    }
}

Now if I understand this correctly, the button function will not swap out URls, but update we can update a style tag in the header of the page to toggle the following and that would work the same as the OS preferences.

<html lang="en" style="color-scheme: light/dark;">

Comment on lines +31 to +34
{
label: 'JetStream Dark',
url: 'JETSTREAM DARK URL'
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{
label: 'JetStream Dark',
url: 'JETSTREAM DARK URL'
}

<auro-checkbox-group required>
${this.themes.map((theme) => html`
<auro-checkbox
value="${JSON.stringify(theme)}"
Copy link
Member

Choose a reason for hiding this comment

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

The only 2 themes are Auro and Jetstream. Darkmodes are modes contained within the main theme.

See what spectrum did.
Screen Shot 2023-09-25 at 2 31 46 PM

@jason-capsule42 jason-capsule42 deleted the jbaker/themeSwitcher branch July 19, 2024 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants