work around --text-fg ending up in fields
https://forums.ankiweb.net/t/strange-behaviour-in-the-html-editor/5796/4
This commit is contained in:
parent
64173b5c02
commit
256db85577
@ -4,7 +4,6 @@
|
||||
.field {
|
||||
border: 1px solid var(--border);
|
||||
background: var(--frame-bg);
|
||||
color: var(--text-fg);
|
||||
padding: 5px;
|
||||
overflow-wrap: break-word;
|
||||
overflow: auto;
|
||||
|
@ -343,6 +343,11 @@ function onCutOrCopy() {
|
||||
|
||||
function setFields(fields) {
|
||||
let txt = "";
|
||||
// webengine will include the variable after enter+backspace
|
||||
// if we don't convert it to a literal colour
|
||||
const color = window
|
||||
.getComputedStyle(document.documentElement)
|
||||
.getPropertyValue("--text-fg");
|
||||
for (let i = 0; i < fields.length; i++) {
|
||||
const n = fields[i][0];
|
||||
let f = fields[i][1];
|
||||
@ -369,6 +374,7 @@ function setFields(fields) {
|
||||
oncut='onCutOrCopy(this);'
|
||||
contentEditable=true
|
||||
class=field
|
||||
style='color: ${color}'
|
||||
>${f}</div>
|
||||
</td>
|
||||
</tr>`;
|
||||
|
Loading…
Reference in New Issue
Block a user