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) {
backgroundColor = "background-color: #000;";
} else {
backgroundColor =
" --inherited-color: inherit;" +
" background-color: var(--inherited-color, #000);" +
" color: var(--inherited-color, #000);" +
" mix-blend-mode: difference;" +
" filter: invert(85%);";
backgroundColor = `
--inherited-color: inherit;
background-color: var(--inherited-color, #000);
color: var(--inherited-color, #000);
mix-blend-mode: difference;
filter: invert(85%);
`;
}
const style = ".CaretBrowsing_Caret {" +
" position: absolute;" +
" z-index: 2147483647;" +
" min-height: 1em;" +
" min-width: 0.2em;" +
" animation: blink 1s step-end infinite;" +
backgroundColor +
"}" +
"@keyframes blink {" +
" 50% { visibility: hidden; }" +
"}";
const style = `
.CaretBrowsing_Caret {
position: absolute;
z-index: 2147483647;
min-height: 1em;
min-width: 0.2em;
animation: blink 1s step-end infinite;
${backgroundColor}
}
@keyframes blink {
50% { visibility: hidden; }
}
`;
const node = document.createElement("style");
node.innerHTML = style;
document.body.appendChild(node);