fix: iOS 26 troubleshooting 1.0
This commit is contained in:
@@ -6,6 +6,34 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta name="color-scheme" content="light dark">
|
<meta name="color-scheme" content="light dark">
|
||||||
<title>MotoVaultPro</title>
|
<title>MotoVaultPro</title>
|
||||||
|
|
||||||
|
<!-- Dark mode initialization - MUST run before any other scripts -->
|
||||||
|
<!-- This prevents iOS 26 Safari from overriding our dark mode preference -->
|
||||||
|
<script>
|
||||||
|
(function() {
|
||||||
|
try {
|
||||||
|
const stored = localStorage.getItem('motovaultpro-mobile-settings');
|
||||||
|
const settings = stored ? JSON.parse(stored) : {};
|
||||||
|
|
||||||
|
// Check user preference, fall back to system preference
|
||||||
|
const prefersDark = settings.darkMode !== undefined
|
||||||
|
? settings.darkMode
|
||||||
|
: window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||||
|
|
||||||
|
if (prefersDark) {
|
||||||
|
document.documentElement.classList.add('dark');
|
||||||
|
} else {
|
||||||
|
document.documentElement.classList.remove('dark');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// Fallback to system preference on error
|
||||||
|
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||||
|
document.documentElement.classList.add('dark');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- Runtime config MUST load synchronously before any module scripts -->
|
<!-- Runtime config MUST load synchronously before any module scripts -->
|
||||||
<script src="/config.js"></script>
|
<script src="/config.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -15,20 +15,23 @@ body {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Tell browser we support both color schemes for native UI elements (scrollbars, form controls) */
|
||||||
|
/* This enables iOS Safari to properly handle dark mode */
|
||||||
:root {
|
:root {
|
||||||
color-scheme: light;
|
color-scheme: light dark;
|
||||||
}
|
-webkit-color-scheme: light dark; /* iOS Safari fallback */
|
||||||
|
|
||||||
:root.dark {
|
|
||||||
color-scheme: dark;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Base styles on html element */
|
||||||
html {
|
html {
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
color: #1e293b;
|
color: #1e293b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Dark mode overrides when .dark class is present */
|
||||||
html.dark {
|
html.dark {
|
||||||
background-color: #231F1C;
|
background-color: #231F1C;
|
||||||
color: #F2F3F6;
|
color: #F2F3F6;
|
||||||
|
color-scheme: dark;
|
||||||
|
-webkit-color-scheme: dark;
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user