User:Canadabonk/sandbox.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 45:
darkmodevars[x] = tohex(cosmostweaksCSS[1].style.getPropertyValue(x));
}
const newVarsCSS = `
:root {
${lightmodevars}
}
.cosmostweaks-darkmode {
${darkmodevars}
}`;
const newVars = mw.util.addCSS(newVarsCSS);
function createinput(color) {
Line 63 ⟶ 73:
colorlist += x + ": " + list[x] + '\n';
}
console.log(colorlist);
$(name).text(colorlist);
}
Line 76 ⟶ 85:
${CSSvarsRows()}
</table>
<table>
<tr><td style="width:50%">
<p>Light mode colors:</p>
<pre class="lightmodevars">
</pre></td>
<td><p>Dark mode colors:</p>
<pre class="darkmodevars">
</pre></td></tr></table>
`);
Line 89 ⟶ 100:
variable = $(e.target).closest('tr').attr('data-row');
console.log(color);
$(e.target).attr('value', color);
$(e.target).siblings('input').attr('value', color);
Line 101 ⟶ 111:
printcolors(darkmodevars, ".darkmodevars");
}
$(newVars.ownerNode).html(newVarsCSS);
});
printcolors(lightmodevars, ".lightmodevars");
printcolors(darkmodevars, ".darkmodevars");
}
});
250

edits