mirror of
https://github.com/ankitects/anki.git
synced 2025-11-26 06:27:12 -05:00
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
2 changed files with 6 additions and 1 deletions
|
|
@ -4,7 +4,6 @@
|
||||||
.field {
|
.field {
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
background: var(--frame-bg);
|
background: var(--frame-bg);
|
||||||
color: var(--text-fg);
|
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
overflow-wrap: break-word;
|
overflow-wrap: break-word;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
|
||||||
|
|
@ -343,6 +343,11 @@ function onCutOrCopy() {
|
||||||
|
|
||||||
function setFields(fields) {
|
function setFields(fields) {
|
||||||
let txt = "";
|
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++) {
|
for (let i = 0; i < fields.length; i++) {
|
||||||
const n = fields[i][0];
|
const n = fields[i][0];
|
||||||
let f = fields[i][1];
|
let f = fields[i][1];
|
||||||
|
|
@ -369,6 +374,7 @@ function setFields(fields) {
|
||||||
oncut='onCutOrCopy(this);'
|
oncut='onCutOrCopy(this);'
|
||||||
contentEditable=true
|
contentEditable=true
|
||||||
class=field
|
class=field
|
||||||
|
style='color: ${color}'
|
||||||
>${f}</div>
|
>${f}</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>`;
|
</tr>`;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue