Error: Stub out support for theming #2077
Merged
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.
Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1209121419454298/task/1211842297547581
Updates the error special page (
errorpage) to accept$THEME_VARIANT$as an interpolated string and exposewindow.onChangeTheme({ themeVariant })as a method native can use to adjust the variant in realtime.Adjusts the default background colour according to the set variant so that something observable happens when setting a theme.
Intention here is to do the minimal amount needed to unblock the native apps. In follow up PRs I’ll import theme variables from the design-tokens repo and update more than just the background colour.
Testing Steps
data-theme-variantto”rose”(or any valid variant).window.onChangeTheme({ themeVariant: ‘desert’ })(or any valid variant) in DevTools.Checklist
<!—
These questions are a friendly reminder to shipping code, if you're uncertain ask the AoR owners.
It's also totally appropriate to not check some of these boxes, if they don't apply to your change.
—>
Please tick all that apply:
Note
Adds theme variant support to the error page via
data-theme-variant, awindow.onChangeThemeruntime hook, and variant-specific backgrounds for light/dark modes.pages/errorpagepublic/index.html): Initializebodywithdata-theme-variant="$THEME_VARIANT$"; addwindow.onChangeTheme(payload)to updatedocument.body.dataset.themeVariantat runtime.public/style.css): Define background colors for theme variants (coolGray,slateBlue,green,violet,rose,orange,desert) in light and dark modes via[data-theme-variant="..."]selectors.readme.md): Document theming mechanisms, supported variants, payload format, and example usage.Written by Cursor Bugbot for commit 956e168. This will update automatically on new commits. Configure here.