xref: /expo/packages/expo-router/build/static/html.js (revision 6c5f8b44)
1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3    return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6exports.Html = exports.ScrollViewStyleReset = void 0;
7/**
8 * Copyright © 2023 650 Industries.
9 *
10 * This source code is licensed under the MIT license found in the
11 * LICENSE file in the root directory of this source tree.
12 */
13const react_1 = __importDefault(require("react"));
14/**
15 * Root style-reset for full-screen React Native web apps with a root `<ScrollView />` should use the following styles to ensure native parity. [Learn more](https://necolas.github.io/react-native-web/docs/setup/#root-element).
16 */
17function ScrollViewStyleReset() {
18    return (react_1.default.createElement("style", { id: "expo-reset", dangerouslySetInnerHTML: {
19            __html: `#root,body{display:flex}#root,body,html{width:100%;-webkit-overflow-scrolling:touch;margin:0;padding:0;min-height:100%}#root{flex-shrink:0;flex-basis:auto;flex-grow:1;flex:1}html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;height:calc(100% + env(safe-area-inset-top))}body{overflow-y:auto;overscroll-behavior-y:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-ms-overflow-style:scrollbar}`,
20        } }));
21}
22exports.ScrollViewStyleReset = ScrollViewStyleReset;
23function Html({ children }) {
24    return (react_1.default.createElement("html", { lang: "en" },
25        react_1.default.createElement("head", null,
26            react_1.default.createElement("meta", { charSet: "utf-8" }),
27            react_1.default.createElement("meta", { httpEquiv: "X-UA-Compatible", content: "IE=edge" }),
28            react_1.default.createElement("meta", { name: "viewport", content: "width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1.00001,viewport-fit=cover" }),
29            react_1.default.createElement(ScrollViewStyleReset, null)),
30        react_1.default.createElement("body", null, children)));
31}
32exports.Html = Html;
33//# sourceMappingURL=html.js.map