@oddbird/css-anchor-positioning
Version:
Polyfill for the proposed CSS anchor positioning spec
2 lines (1 loc) • 780 B
JavaScript
import{p as o}from"./polyfill-SWhtadZ6.js";const i="anchorName"in document.documentElement.style,e=document.getElementById("apply-polyfill");i?(e.innerText="No Polyfill Needed",e.setAttribute("disabled",""),console.log("anchor-positioning is supported in this browser; polyfill skipped.")):e.addEventListener("click",()=>o().then(l=>{e.innerText="Polyfill Applied",e.setAttribute("disabled",""),console.log(l);const t=document.getElementById("toggle-wrapper");t.removeAttribute("disabled"),t.innerText="Toggle Wrapper Visibility"}));document.getElementById("toggle-wrapper").addEventListener("click",()=>{document.body.classList.toggle("show-wrapper")});document.getElementById("switch-cascade").addEventListener("click",()=>{document.body.classList.toggle("cascade-override")});