Repository navigation
feat(settings): Add a theme variant picker to the Appearance page - #132283
Draft
sentry-junior[bot] wants to merge 2 commits into
Draft
sentry-junior[bot] wants to merge 2 commits into
sentry-junior[bot] wants to merge 2 commits into
Conversation
Light and Dark sections of ToggleCard radios, each card with a mock-UI preview scoped by data-color-scheme and data-theme-dark. The selection lives in component state until we decide where to store it. Refs DE-1899 Co-Authored-By: nate <7118177+natemoo-re@users.noreply.github.com>
The picker reads and saves the themeVariantLight and themeVariantDark user options through PUT /users/me/. With theme-variants on, the provider sets data-theme-dark on <html> for a non-default dark theme. Refs DE-1897 Co-Authored-By: nate <7118177+natemoo-re@users.noreply.github.com>
This branch was successfully deployed
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.
Adds Light and Dark theme pickers to Account Settings → Appearance, so people can choose the ash or midnight dark theme.
Stack: this is stacked on #131865, which is stacked on #131861. It needs #132274, the backend PR that adds the
themeVariantLightandthemeVariantDarkuser options. Land the backend first.What changes
ToggleCards, one per color scheme:themeVariables(var(--scraps-*)). The preview root setsdata-color-scheme, and dark cards also setdata-theme-dark, so theme.css styles each preview on its own. The Default dark card setsdata-theme-dark="default", which stops an ash or midnight theme set on<html>from reaching it.user.options.themeVariantLightandthemeVariantDark. They save throughPUT /users/me/with a partial{options: {themeVariantDark: 'ash'}}, the same way the Theme select savestheme. A failed save puts back the saved value and shows an error toast.ThemeAndStyleProvidersetsdata-theme-darkon<html>fromthemeVariantDarkwhen the org hasorganizations:theme-variantsand the value isn'tdefault, and removes it otherwise.User['options']gainsthemeVariantLight?: 'default'andthemeVariantDark?: 'default' | 'ash' | 'midnight'. They're optional because frontend and backend deploy separately.Gating
Gating is UI-only, behind
organizations:theme-variants. The Appearance page already shows nothing when the flag is off, and<html>only getsdata-theme-darkwhen the flag is on.PUT /users/me/has no organization to check the flag against.Refs DE-1897
via @natemoo-re.
--
View Session [Sentry]