UNPKG

@formidable-webview/webshell

Version:

🔥 Craft Robust React Native WebView-based components with ease.

28 lines (23 loc) • 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.InjectStyleFeature = void 0; var _FeatureBuilder = _interopRequireDefault(require("../FeatureBuilder")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } /* babel-plugin-inline-import './InjectStyleFeature.webjs' */ var injectStyleScript = "function InjectStyleFeature(context) {\n var options = context.options || {},\n css = options.css || '',\n head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n style.type = 'text/css';\n style.appendChild(document.createTextNode(css));\n head.appendChild(style);\n}\n"; /** * This feature injects a `<style>` element in the header of the page. * * @public */ var InjectStyleFeature = new _FeatureBuilder["default"]({ defaultOptions: { css: '' }, identifier: '@native-html/iframe-strip-body-spacing', script: injectStyleScript }).build(); exports.InjectStyleFeature = InjectStyleFeature; //# sourceMappingURL=InjectStyleFeature.js.map