Make Glass's top bar solid on a phone, so the strip above it matches (#147)
In a home-screen app iOS paints the strip behind the status bar and the Dynamic Island itself, in one flat colour, from theme-color. Glass's bar is see-through, so theme-color fell back to Glass's page background, #0b0d14 (#eef1f7 light), above a bar that showed #191e34 on average, bluer at the left and purple at the right: a near-black band, or a white one in light mode. No flat strip can match a see-through bar, so on a phone the bar is solid, in what it showed on average (--glass-bar, measured in Chromium off the bar's top edge), and theme-color carries the same colour. Everywhere else Glass is as it was. The browser test checks the bar is solid and theme-color equals it in both modes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1673,5 +1673,13 @@ test.describe('on a narrow phone', () => {
|
||||
expect(bar.slice(0, 2)).toEqual(['sticky', 0]);
|
||||
expect(bar[2]).toBe(await page.evaluate(() => getComputedStyle(document.body).backgroundColor));
|
||||
expect(await page.evaluate(() => document.querySelector('meta[name=theme-color]').content)).toBe(bar[2]);
|
||||
// Glass's bar is see-through on a desktop, which no flat strip can match: solid on a phone.
|
||||
for (const mode of ['dark', 'light']) {
|
||||
const [c, tc] = await page.evaluate(m => { setTheme('glass', m);
|
||||
return [getComputedStyle(document.querySelector('#topbar')).backgroundColor, document.querySelector('meta[name=theme-color]').content]; }, mode);
|
||||
expect(c).toMatch(/^rgb\(/);
|
||||
expect(tc).toBe(c);
|
||||
}
|
||||
await page.evaluate(() => setTheme('modern', 'dark'));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user