feat(launchpad): optional fixed background color for the page - #60
Merged
Merged
Conversation
settings.launchpad.backgroundColor (#rrggbb) fixes the page background; ink, muted text, surfaces and borders are derived from its luminance, so a light and a dark brand both stay legible. Unset, the page keeps following the visitor's light/dark preference. The theme a resolveContent hook returns can carry it too.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The Launchpad page follows the visitor's light/dark preference and exposes only an accent. An operator who wants the page in their brand's background has no knob for it.
Change
LaunchpadSettings.backgroundColorandLaunchpadTheme.backgroundColor(#rrggbb, anything else dropped — same validation asaccentColor). Read byreadLaunchpadSettings, carried throughdefaultLaunchpadContent, and honored from aresolveContenthook's theme.launchpadPaletteCss(backgroundColor)derives the rest of the palette: ink and muted text from whichever default set reads on that background (WCAG luminance, the same test the accent uses for button text), surfaces and borders as the background nudged 6% / 14% toward the ink. Emitted after the base styles so it overrides both the light default and the dark media query — with a background set, the page no longer changes with the visitor's theme.Tests — reader keeps/drops it; a dark background gets light ink and a light one dark ink with the exact derived surfaces; a non-hex value is ignored; no override is emitted when unset. 385 passing.
README: field documented under the Launchpad settings block.
Stacked on #59 in spirit only — both touch
launchpad.ts, no textual overlap; either merges first.