Files
FixIt/assets/js/head/platform.ts
T

13 lines
368 B
TypeScript

/**
* Platform detection — runs synchronously in `<head>` before body rendering.
*
* Responsibilities:
* - Detect macOS platform from user agent.
* - Set `data-platform` on `<html>` to enable platform-specific CSS styling.
*/
export function initPlatform() {
if (/mac/i.test(navigator.platform)) {
document.documentElement.dataset.platform = 'mac'
}
}