UNPKG

ll-package

Version:

2 lines (1 loc) 990 B
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("./canUseDom.js"),u=()=>d.default()&&window.document.documentElement,l=e=>{if(d.default()&&window.document.documentElement){const t=Array.isArray(e)?e:[e],{documentElement:n}=window.document;return t.some(r=>r in n.style)}return!1},i=(e,t)=>{if(!l(e))return!1;const n=document.createElement("div"),r=n.style[e];return n.style[e]=t,n.style[e]!==r};function c(e,t){return!Array.isArray(e)&&t!==void 0?i(e,t):l(e)}let o;const s=()=>{if(!u())return!1;if(o!==void 0)return o;const e=document.createElement("div");return e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e),o=e.scrollHeight===1,document.body.removeChild(e),o};exports.canUseDocElement=u;exports.default=c;exports.detectFlexGapSupported=s;exports.isStyleSupport=c;