Files
cinny-mobile/overlay/src/font-setup.ts
litruv a887cd39f1
All checks were successful
Build / increment-version (push) Successful in 4s
Build / build-android (push) Successful in 4m22s
Build / create-release (push) Successful in 13s
Fix Stationery theme on Android by keeping overlay hooks and CSS.
2026-07-23 01:32:44 +10:00

24 lines
769 B
TypeScript

const cap =
typeof window !== 'undefined'
? (window as { Capacitor?: { isNativePlatform?: () => boolean; getPlatform?: () => string } }).Capacitor
: undefined;
export const isCapacitorAndroid = Boolean(
cap?.isNativePlatform?.() && cap?.getPlatform?.() === 'android'
);
// Stationery signatures use Caveat on all platforms (including Android WebView).
await import('@fontsource/caveat/500.css');
await import('@fontsource/caveat/600.css');
await import('@fontsource/caveat/700.css');
if (isCapacitorAndroid) {
document.documentElement.classList.add('android-capacitor');
document.documentElement.style.setProperty(
'--font-secondary',
'system-ui, Roboto, "Noto Sans", sans-serif'
);
} else {
await import('@fontsource-variable/inter');
}