首页 > 使用SCSS高亮显示控件、聚焦位置

使用SCSS高亮显示控件、聚焦位置

 

/*强调SCSS----------------------------------------*/
[sg-emphasize],/deep/[sg-emphasize] {animation: sg-emphasize .3s ease 3;
}@keyframes sg-emphasize {0% {transform: scale(1);background: rgba(3, 156, 253, 0);}50% {transform: scale(.9);background: rgba(3, 156, 253, 0.2);}100% {transform: scale(1);background: rgba(3, 156, 253, 0);}
}/*强调js----------------------------------------*/
function emphasizeFocus(emphasizeSel, focusSel) {var emphasizeDom = document.querySelector(emphasizeSel);var inputDom = focusSel ? document.querySelector(focusSel) : emphasizeDom;emphasizeDom.setAttribute("sg-emphasize", true), setTimeout(() => emphasizeDom.removeAttribute("sg-emphasize"), 900);inputDom.scrollIntoView({behavior: "smooth", block: "nearest", inline: "nearest"}), inputDom.focus();
}

更多相关: