UNPKG

vw-calc

Version:

Sass function to scale pixel-based value(s) proportionally and accessible.

3 lines (2 loc) 695 B
(()=>{let t=document.querySelectorAll(".js-target-input"),e=()=>{t.forEach(t=>{let e=t?.getAttribute("data-target"),r=document.querySelectorAll(`.js-target-styled-output[data-target="${e}"]`),l=document.querySelectorAll(`.js-target-computed-output[data-target="${e}"]`);if(!r||!l)return;let o=document.styleSheets[0].cssRules;for(let t=0;t<o.length;t++){let l=o[t];l instanceof CSSStyleRule&&l.selectorText===`.demo--${e}`&&r.forEach(t=>{let e=t.getAttribute("data-property");e&&(t.textContent=l.style[e])})}l.forEach(e=>{let r=e.getAttribute("data-property");r&&(e.textContent=getComputedStyle(t)[r])})})};e(),window.addEventListener("resize",e)})(); //# sourceMappingURL=index.6ce80d62.js.map