Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

Train fix: name the root colour scheme on iOS WebKit only

milind-sonid258303c1f43
diff --git a/src/lib/skins.test.ts b/src/lib/skins.test.ts
index d703296950..1f5c7d96bd 100644
--- a/src/lib/skins.test.ts
+++ b/src/lib/skins.test.ts
@@ -58,7 +58,7 @@ describe("skins", () => {
expect(body).toContain(`--code-color-scheme: ${scheme};`);
}
expect(css).toMatch(/\.chat-md \.shiki\s*\{\s*color-scheme:\s*var\(--code-color-scheme\);\s*\}/);
- expect(css).toMatch(/html\s*\{\s*background-color:\s*var\(--color-app\);\s*color-scheme:\s*var\(--code-color-scheme\);\s*\}/);
+ expect(css).toMatch(/@supports \(-webkit-touch-callout: none\) \{\s*html\s*\{\s*background-color:\s*var\(--color-app\);\s*color-scheme:\s*var\(--code-color-scheme\);\s*\}\s*\}/);
});
it("adds Meadow without moving or replacing the original eight", () => {
diff --git a/src/styles.css b/src/styles.css
index 9c66cf192c..1fa4dba502 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -1373,10 +1373,13 @@ body,
/* iOS Safari keeps its bottom bar in light mode unless the root names a
scheme. The bar's color is theme-color, copied from --color-app when the
skin changes. The root itself has to paint the same ground, or the home
- indicator inset stays the canvas white. */
-html {
- background-color: var(--color-app);
- color-scheme: var(--code-color-scheme);
+ indicator inset stays the canvas white. Only on iOS WebKit: elsewhere the
+ scheme stays scoped to code, so native controls keep their styling. */
+@supports (-webkit-touch-callout: none) {
+ html {
+ background-color: var(--color-app);
+ color-scheme: var(--code-color-scheme);
+ }
}
/* Standalone phone windows can reach behind the notch and home indicator.