Use ES6 template strings
This commit is contained in:
parent
772654bcae
commit
c37134861e
@ -870,27 +870,30 @@ window._qutebrowser.caret = (function() {
|
|||||||
CaretBrowsing.injectCaretStyles = function() {
|
CaretBrowsing.injectCaretStyles = function() {
|
||||||
let backgroundColor;
|
let backgroundColor;
|
||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user