Use ES6 template strings

This commit is contained in:
Florian Bruhin 2018-06-12 16:49:54 +02:00
parent 772654bcae
commit c37134861e

View File

@ -872,25 +872,28 @@ window._qutebrowser.caret = (function() {
if (CaretBrowsing.isOldQt) { if (CaretBrowsing.isOldQt) {
backgroundColor = "background-color: #000;"; backgroundColor = "background-color: #000;";
} else { } else {
backgroundColor = backgroundColor = `
" --inherited-color: inherit;" + --inherited-color: inherit;
" background-color: var(--inherited-color, #000);" + background-color: var(--inherited-color, #000);
" color: var(--inherited-color, #000);" + color: var(--inherited-color, #000);
" mix-blend-mode: difference;" + mix-blend-mode: difference;
" filter: invert(85%);"; filter: invert(85%);
`;
} }
const style = ".CaretBrowsing_Caret {" + const style = `
" position: absolute;" + .CaretBrowsing_Caret {
" z-index: 2147483647;" + position: absolute;
" min-height: 1em;" + z-index: 2147483647;
" min-width: 0.2em;" + min-height: 1em;
" animation: blink 1s step-end infinite;" + min-width: 0.2em;
backgroundColor + animation: blink 1s step-end infinite;
"}" + ${backgroundColor}
"@keyframes blink {" + }
" 50% { visibility: hidden; }" + @keyframes blink {
"}"; 50% { visibility: hidden; }
}
`;
const node = document.createElement("style"); const node = document.createElement("style");
node.innerHTML = style; node.innerHTML = style;
document.body.appendChild(node); document.body.appendChild(node);