Use -webkit-filter on old Qt

This commit is contained in:
Florian Bruhin 2018-06-12 17:01:34 +02:00
parent 5435609552
commit 1541088e76
2 changed files with 7 additions and 14 deletions

View File

@ -56,3 +56,4 @@ rules:
no-bitwise: "off" no-bitwise: "off"
no-ternary: "off" no-ternary: "off"
max-lines: "off" max-lines: "off"
multiline-ternary: ["error", "always-multiline"]

View File

@ -868,19 +868,7 @@ window._qutebrowser.caret = (function() {
}; };
CaretBrowsing.injectCaretStyles = function() { CaretBrowsing.injectCaretStyles = function() {
let backgroundColor; const prefix = CaretBrowsing.isOldQt ? "-webkit-" : "";
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%);
`;
}
const style = ` const style = `
.CaretBrowsing_Caret { .CaretBrowsing_Caret {
position: absolute; position: absolute;
@ -888,7 +876,11 @@ window._qutebrowser.caret = (function() {
min-height: 1em; min-height: 1em;
min-width: 0.2em; min-width: 0.2em;
animation: blink 1s step-end infinite; animation: blink 1s step-end infinite;
${backgroundColor} --inherited-color: inherit;
background-color: var(--inherited-color, #000);
color: var(--inherited-color, #000);
mix-blend-mode: difference;
${prefix}filter: invert(85%);
} }
@keyframes blink { @keyframes blink {
50% { visibility: hidden; } 50% { visibility: hidden; }