mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
13 lines
368 B
TypeScript
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'
|
|
}
|
|
}
|