NTP: Stub out support for theme variants #2065
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/1211790481771801?focus=true
Description
Updates
initialSetup,customizer_setThemeandcustomizer_onThemeUpdateto allow setting athemeVariantper https://app.asana.com/1/137249556945/project/1209121419454298/task/1212083006586484?focus=true.Adjusts the default background colour according to the set variant so that something observable happens when sending
customizer_setTheme.Marks
customizer.defaultStylesas deprecated and updates the docs to remove references to this.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
Checklist
Please tick all that apply:
Note
Adds
themeVariantto the New Tab customizer, wiring it through context, messaging, and CSS to change default background colors; updates schemas, mocks, docs, and tests.themeVariantviaCustomizerThemesContextanduseThemes(app/customizer/themes.js,CustomizerProvider.js,components/App.js,components/Components.jsx).BackgroundConsumernow appliesdata-theme-varianttobodyand respects variant when default background is used.body[data-theme-variant=…]inapp/styles/ntp-theme.css.themeVariantinCustomizerData,ThemeData, andcustomizer_setTheme(messages/types/*.json,messages/customizer_setTheme.notify.json,types/new-tab.ts).themechanges inCustomizerProvider.?themeVariant=URL param and include in mockcustomizerdata (app/customizer/mocks.js).public/index.html: use$LOADING_COLOR$token for initial background.themeVariantand deprecatedefaultStyles(app/customizer/customizer.md,readme.md).acceptsThemeVariantUpdate(integration-tests/*).Written by Cursor Bugbot for commit 43f3691. This will update automatically on new commits. Configure here.